Cody

# Problem 42841. Return the sequence element III

Solution 2635474

Submitted on 30 Jun 2020
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   Fail
x1 = 1; x2 = 2; n = 5; y_correct = 6; assert(isequal(ulam(x1,x2,n),y_correct))

a = 3 a = 4 8 a = 10 20 a = 20 60 a = 40 160 s = 1 2 3 4 10 20 40

Output argument "y" (and maybe others) not assigned during call to "ulam". Error in Test1 (line 5) assert(isequal(ulam(x1,x2,n),y_correct))

2   Fail
x1 = 1; x2 = 2; n = 22; y_correct = 77; assert(isequal(ulam(x1,x2,n),y_correct))

a = 3 a = 4 8 a = 10 20 a = 20 60 a = 40 160 a = 80 400 a = 160 960 a = 320 2240 a = 640 5120 a = 1280 11520 a = 2560 25600 a = 5120 56320 a = 10240 122880 a = 20480 266240 a = 40960 573440 a = 81920 1228800 a = 163840 2621440 a = 327680 5570560 a = 655360 11796480 a = 1310720 24903680 a = 2621440 52428800 a = 5242880 110100480 s = Columns 1 through 15 1 2 3 4 10 20 40 80 160 320 640 1280 2560 5120 10240 Columns 16 through 24 20480 40960 81920 163840 327680 655360 1310720 2621440 5242880

Output argument "y" (and maybe others) not assigned during call to "ulam". Error in Test2 (line 5) assert(isequal(ulam(x1,x2,n),y_correct))

3   Fail
x1 = 1; x2 = 3; n = 49; y_correct = 212; assert(isequal(ulam(x1,x2,n),y_correct))

a = 4 a = 5 11 a = 13 26 a = 26 78 a = 52 208 a = 104 520 a = 208 1248 a = 416 2912 a = 832 6656 a = 1664 14976 a = 3328 33280 a = 6656 73216 a = 13312 159744 a = 26624 346112 a = 53248 745472 a = 106496 1597440 a = 212992 3407872 a = 425984 7241728 a = 851968 15335424 a = 1703936 32374784 a = 3407872 68157440 a = 6815744 143130624 a = 13631488 299892736 a = 27262976 627048448 a = 1.0e+09 * 0.0545 1.3086 a = 1.0e+09 * 0.1091 2.7263 a = 1.0e+09 * 0.2181 5.6707 a = 1.0e+10 * 0.0436 1.1778 a = 1.0e+10 * 0.0872 2.4428 a = 1.0e+10 * 0.1745 5.0600 a = 1.0e+11 * 0.0349 1.0469 a = 1.0e+11 * 0.0698 2.1636 a = 1.0e+11 * 0.1396 4.4668 a = 1.0e+11 * 0.2792 9.2127 a = 1.0e+12 * 0.0558 1.8984 a = 1.0e+12 * 0.1117 3.9084 a = 1.0e+12 * 0.2233 8.0402 a = 1.0e+13 * 0.0447 1.6527 a = 1.0e+13 * 0.0893 3.3947 a = 1.0e+13 * 0.1787 6.9682 a = 1.0e+14 * 0.0357 1.4294 a = 1.0e+14 * 0.0715 2.9302 a = 1.0e+14 * 0.1429 6.0033 a = 1.0e+15 * 0.0286 1.2293 a = 1.0e+15 * 0.0572 2.5157 a = 1.0e+15 * 0.1143 5.1457 a = 1.0e+16 * 0.0229 1.0520 a = 1.0e+16 * 0.0457 2.1498 a = 1.0e+16 * 0.0915 4.3910 s = 1.0e+14 * Columns 1 through 18 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 Columns 19 through 36 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0001 0.0001 0.0003 Columns 37 through 51 0.0006 0.0011 0.0022 0.0045 0.0089 0.0179 0.0357 0.0715 0.1429 0.2859 0.5717 1.1435 2.2870 4.5740 9.1479

Output argument "y" (and maybe others) not assigned during call to "ulam". Error in Test3 (line 5) assert(isequal(ulam(x1,x2,n),y_correct))

4   Fail
x1 = 1; x2 = 5; n = 10; y_correct = 22; assert(isequal(ulam(x1,x2,n),y_correct))

a = 6 a = 7 17 a = 19 38 a = 38 114 a = 76 304 a = 152 760 a = 304 1824 a = 608 4256 a = 1216 9728 a = 2432 21888 s = 1 5 6 7 19 38 76 152 304 608 1216 2432

Output argument "y" (and maybe others) not assigned during call to "ulam". Error in Test4 (line 5) assert(isequal(ulam(x1,x2,n),y_correct))

5   Fail
x1 = 2; x2 = 9; n = 8; y_correct = 20; assert(isequal(ulam(x1,x2,n),y_correct))

a = 11 a = 13 31 a = 35 70 a = 70 210 a = 140 560 a = 280 1400 a = 560 3360 a = 1120 7840 s = 2 9 11 13 35 70 140 280 560 1120

Output argument "y" (and maybe others) not assigned during call to "ulam". Error in Test5 (line 5) assert(isequal(ulam(x1,x2,n),y_correct))

6   Fail
x1 = 2; x2 = 9; n = 26; y_correct = 77; assert(isequal(ulam(x1,x2,n),y_correct))

a = 11 a = 13 31 a = 35 70 a = 70 210 a = 140 560 a = 280 1400 a = 560 3360 a = 1120 7840 a = 2240 17920 a = 4480 40320 a = 8960 89600 a = 17920 197120 a = 35840 430080 a = 71680 931840 a = 143360 2007040 a = 286720 4300800 a = 573440 9175040 a = 1146880 19496960 a = 2293760 41287680 a = 4587520 87162880 a = 9175040 183500800 a = 18350080 385351680 a = 36700160 807403520 a = 1.0e+09 * 0.0734 1.6882 a = 1.0e+09 * 0.1468 3.5232 a = 1.0e+09 * 0.2936 7.3400 s = Columns 1 through 15 2 9 11 13 35 70 140 280 560 1120 2240 4480 8960 17920 35840 Columns 16 through 28 71680 143360 286720 573440 1146880 2293760 4587520 9175040 18350080 36700160 73400320 146800640 293601280

Output argument "y" (and maybe others) not assigned during call to "ulam". Error in Test6 (line 5) assert(isequal(ulam(x1,x2,n),y_correct))

7   Fail
x1 = 4; x2 = 5; n = 29; y_correct = 123; assert(isequal(ulam(x1,x2,n),y_correct))

a = 9 a = 13 23 a = 31 62 a = 62 186 a = 124 496 a = 248 1240 a = 496 2976 a = 992 6944 a = 1984 15872 a = 3968 35712 a = 7936 79360 a = 15872 174592 a = 31744 380928 a = 63488 825344 a = 126976 1777664 a = 253952 3809280 a = 507904 8126464 a = 1015808 17268736 a = 2031616 36569088 a = 4063232 77201408 a = 8126464 162529280 a = 16252928 341311488 a = 32505856 715128832 a = 1.0e+09 * 0.0650 1.4953 a = 1.0e+09 * 0.1300 3.1206 a = 1.0e+09 * 0.2600 6.5012 a = 1.0e+10 * 0.0520 1.3522 a = 1.0e+10 * 0.1040 2.8085 a = 1.0e+10 * 0.2080 5.8250 s = 1.0e+09 * Columns 1 through 18 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0001 0.0001 0.0003 Columns 19 through 31 0.0005 0.0010 0.0020 0.0041 0.0081 0.0163 0.0325 0.0650 0.1300 0.2600 0.5201 1.0402 2.0804

Output argument "y" (and maybe others) not assigned during call to "ulam". Error in Test7 (line 5) assert(isequal(ulam(x1,x2,n),y_correct))

8   Fail
x1 = 6; x2 = 7; n = 29; y_correct = 123; assert(isequal(ulam(x1,x2,n),y_correct))

a = 13 a = 19 33 a = 45 90 a = 90 270 a = 180 720 a = 360 1800 a = 720 4320 a = 1440 10080 a = 2880 23040 a = 5760 51840 a = 11520 115200 a = 23040 253440 a = 46080 552960 a = 92160 1198080 a = 184320 2580480 a = 368640 5529600 a = 737280 11796480 a = 1474560 25067520 a = 2949120 53084160 a = 5898240 112066560 a = 11796480 235929600 a = 23592960 495452160 a = 1.0e+09 * 0.0472 1.0381 a = 1.0e+09 * 0.0944 2.1706 a = 1.0e+09 * 0.1887 4.5298 a = 1.0e+09 * 0.3775 9.4372 a = 1.0e+10 * 0.0755 1.9629 a = 1.0e+10 * 0.1510 4.0769 a = 1.0e+10 * 0.3020 8.4557 s = 1.0e+09 * Columns 1 through 18 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0001 0.0002 0.0004 Columns 19 through 31 0.0007 0.0015 0.0029 0.0059 0.0118 0.0236 0.0472 0.0944 0.1887 0.3775 0.7550 1.5099 3.0199

Output argument "y" (and maybe others) not assigned during call to "ulam". Error in Test8 (line 5) assert(isequal(ulam(x1,x2,n),y_correct))