Cody

Solution 1907091

Submitted on 21 Aug 2019
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Pass
x = 31; y_correct = 31; assert(isequal(primeFactors(x),y_correct))

v = 2 3 5 7 11 13 17 19 23 29 31 v2 = 31 t = 15.5000 v2 = 1×0 empty double row vector t = 7.7500 v2 = 1×0 empty double row vector t = 3.8750 v2 = 1×0 empty double row vector t = 1.9375 v2 = 1×0 empty double row vector t = 0.9688

2   Pass
x = 37; y_correct = 37; assert(isequal(primeFactors(x),y_correct))

v = 2 3 5 7 11 13 17 19 23 29 31 37 v2 = 37 t = 18.5000 v2 = 1×0 empty double row vector t = 9.2500 v2 = 1×0 empty double row vector t = 4.6250 v2 = 1×0 empty double row vector t = 2.3125 v2 = 1×0 empty double row vector t = 1.1562 v2 = 1×0 empty double row vector t = 0.5781

3   Fail
x = 39; y_correct = [13 3]; assert(isequal(primeFactors(x),y_correct))

v = 2 3 5 7 11 13 17 19 23 29 31 37 v2 = 13 t = 19.5000 v2 = 1×0 empty double row vector t = 9.7500 v2 = 1×0 empty double row vector t = 4.8750 v2 = 1×0 empty double row vector t = 2.4375 v2 = 1×0 empty double row vector t = 1.2188 v2 = 1×0 empty double row vector t = 0.6094

Assertion failed.

4   Fail
x = 876; y_correct = [73 3 2 2]; assert(isequal(primeFactors(x),y_correct))

v = Columns 1 through 29 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 101 103 107 109 Columns 30 through 58 113 127 131 137 139 149 151 157 163 167 173 179 181 191 193 197 199 211 223 227 229 233 239 241 251 257 263 269 271 Columns 59 through 87 277 281 283 293 307 311 313 317 331 337 347 349 353 359 367 373 379 383 389 397 401 409 419 421 431 433 439 443 449 Columns 88 through 116 457 461 463 467 479 487 491 499 503 509 521 523 541 547 557 563 569 571 577 587 593 599 601 607 613 617 619 631 641 Columns 117 through 145 643 647 653 659 661 673 677 683 691 701 709 719 727 733 739 743 751 757 761 769 773 787 797 809 811 821 823 827 829 Columns 146 through 150 839 853 857 859 863 v2 = 73 t = 438 v2 = 73 t = 219 v2 = 73 t = 109.5000 v2 = 1×0 empty double row vector t = 54.7500 v2 = 1×0 empty double row vector t = 27.3750 v2 = 1×0 empty double row vector t = 13.6875 v2 = 1×0 empty double row vector t = 6.8438 v2 = 1×0 empty double row vector t = 3.4219 v2 = 1×0 empty double row vector t = 1.7109 v2 = 1×0 empty double row vector t = 0.8555

Assertion failed.