Cody

Solution 1999118

Submitted on 1 Nov 2019 by Asif Newaz
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
n = 1; s_correct = 2; assert(isequal(sumOfSeriesV(n),s_correct))

a = 2 s = 2

2   Pass
n = 3; s_correct = 20; assert(isequal(sumOfSeriesV(n),s_correct))

a = 2 a = 2 6 a = 2 6 12 s = 20

3   Pass
n = 4; s_correct = 40; assert(isequal(sumOfSeriesV(n),s_correct))

a = 2 a = 2 6 a = 2 6 12 a = 2 6 12 20 s = 40

4   Pass
n = 10; s_correct = 440; assert(isequal(sumOfSeriesV(n),s_correct))

a = 2 a = 2 6 a = 2 6 12 a = 2 6 12 20 a = 2 6 12 20 30 a = 2 6 12 20 30 42 a = 2 6 12 20 30 42 56 a = 2 6 12 20 30 42 56 72 a = 2 6 12 20 30 42 56 72 90 a = 2 6 12 20 30 42 56 72 90 110 s = 440

5   Pass
n = 21; s_correct = 3542; assert(isequal(sumOfSeriesV(n),s_correct))

a = 2 a = 2 6 a = 2 6 12 a = 2 6 12 20 a = 2 6 12 20 30 a = 2 6 12 20 30 42 a = 2 6 12 20 30 42 56 a = 2 6 12 20 30 42 56 72 a = 2 6 12 20 30 42 56 72 90 a = 2 6 12 20 30 42 56 72 90 110 a = 2 6 12 20 30 42 56 72 90 110 132 a = 2 6 12 20 30 42 56 72 90 110 132 156 a = 2 6 12 20 30 42 56 72 90 110 132 156 182 a = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 a = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 a = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 a = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 a = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 342 a = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 342 380 a = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 342 380 420 a = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 342 380 420 462 s = 3542

6   Pass
n = 42; s_correct = 26488; assert(isequal(sumOfSeriesV(n),s_correct))

a = 2 a = 2 6 a = 2 6 12 a = 2 6 12 20 a = 2 6 12 20 30 a = 2 6 12 20 30 42 a = 2 6 12 20 30 42 56 a = 2 6 12 20 30 42 56 72 a = 2 6 12 20 30 42 56 72 90 a = 2 6 12 20 30 42 56 72 90 110 a = 2 6 12 20 30 42 56 72 90 110 132 a = 2 6 12 20 30 42 56 72 90 110 132 156 a = 2 6 12 20 30 42 56 72 90 110 132 156 182 a = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 a = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 a = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 a = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 a = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 342 a = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 342 380 a = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 342 380 420 a = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 342 380 420 462 a = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 342 380 420 462 506 a = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 342 380 420 462 506 552 a = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 342 380 420 462 506 552 600 a = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 342 380 420 462 506 552 600 650 a = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 342 380 420 462 506 552 600 650 702 a = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 342 380 420 462 506 552 600 650 702 756 a = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 342 380 420 462 506 552 600 650 702 756 812 a = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 342 380 420 462 506 552 600 650 702 756 812 870 a = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 342 380 420 462 506 552 600 650 702 756 812 870 930 a = Columns 1 through 30 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 342 380 420 462 506 552 600 650 702 756 812 870 930 Column 31 992 a = Columns 1 through 15 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 Columns 16 through 30 272 306 342 380 420 462 506 552 600 650 702 756 812 870 930 Columns 31 through 32 992 1056 a = Columns 1 through 15 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 Columns 16 through 30 272 306 342 380 420 462 506 552 600 650 702 756 812 870 930 Columns 31 through 33 992 1056 1122 a = Columns 1 through 15 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 Columns 16 through 30 272 306 342 380 420 462 506 552 600 650 702 756 812 870 930 Columns 31 through 34 992 1056 1122 1190 a = Columns 1 through 15 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 Columns 16 through 30 272 306 342 380 420 462 506 552 600 650 702 756 812 870 930 Columns 31 through 35 992 1056 1122 1190 1260 a = Columns 1 through 15 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 Columns 16 through 30 272 306 342 380 420 462 506 552 600 650 702 756 812 870 930 Columns 31 through 36 992 1056 1122 1190 1260 1332 a = Columns 1 through 15 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 Columns 16 through 30 272 306 342 380 420 462 506 552 600 650 702 756 812 870 930 Columns 31 through 37 992 1056 1122 1190 1260 1332 1406 a = Columns 1 through 15 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 Columns 16 through 30 272 306 342 380 420 462 506 552 600 650 702 756 812 870 930 Columns 31 through 38 992 1056 1122 1190 1260 1332 1406 1482 a = Columns 1 through 15 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 Columns 16 through 30 272 306 342 380 420 462 506 552 600 650 702 756 812 870 930 Columns 31 through 39 992 1056 1122 1190 1260 1332 1406 1482 1560 a = Columns 1 through 15 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 Columns 16 through 30 272 306 342 380 420 462 506 552 600 650 702 756 812 870 930 Columns 31 through 40 992 1056 1122 1190 1260 1332 1406 1482 1560 1640 a = Columns 1 through 15 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 Columns 16 through 30 272 306 342 380 420 462 506 552 600 650 702 756 812 870 930 Columns 31 through 41 992 1056 1122 1190 1260 1332 1406 1482 1560 1640 1722 a = Columns 1 through 15 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 Columns 16 through 30 272 306 342 380 420 462 506 552 600 650 702 756 812 870 930 Columns 31 through 42 992 1056 1122 1190 1260 1332 1406 1482 1560 1640 1722 1806 s = 26488

7   Pass
n = 88; s_correct = 234960; assert(isequal(sumOfSeriesV(n),s_correct))

a = 2 a = 2 6 a = 2 6 12 a = 2 6 12 20 a = 2 6 12 20 30 a = 2 6 12 20 30 42 a = 2 6 12 20 30 42 56 a = 2 6 12 20 30 42 56 72 a = 2 6 12 20 30 42 56 72 90 a = 2 6 12 20 30 42 56 72 90 110 a = 2 6 12 20 30 42 56 72 90 110 132 a = 2 6 12 20 30 42 56 72 90 110 132 156 a = 2 6 12 20 30 42 56 72 90 110 132 156 182 a = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 a = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 a = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 a = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 a = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 342 a = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 342 380 a = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 342 380 420 a = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 342 380 420 462 a = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 342 380 420 462 506 a = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 342 380 420 462 506 552 a = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 342 380 420 462 506 552 600 a = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 342 380 420 462 506 552 600 650 a = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 342 380 420 462 506 552 600 650 702 a = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 342 380 420 462 506 552 600 650 702 756 a = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 342 380 420 462 506 552 600 650 702 756 812 a = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 342 380 420 462 506 552 600 650 702 756 812 870 a = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 342 380 420 462 506 552 600 650 702 756 812 870 930 a = Columns 1 through 30 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 342 380 420 462 506 552 600 650 702 756 812 870 930 Column 31 992 a = Columns 1 through 15 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 Columns 16 through 30 272 306 342 380 420 462 506 552 600 650 702 756 812 870 930 Columns 31 through 32 992 1056 a = Columns 1 through 15 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 Columns 16 through 30 272 306 342 380 420 462 506 552 600 650 702 756 812 870 930 Columns 31 through 33 992 1056 1122 a = Columns 1 through 15 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 Columns 16 through 30 272 306 342 380 420 462 506 552 600 650 702 756 812 870 930 Columns 31 through 34 992 1056 1122 1190 a = Columns 1 through 15 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 Columns 16 through 30 272 306 342 380 420 462 506 552 600 650 702 756 812 870 930 Columns 31 through 35 992 1056 1122 1190 1260 a = Columns 1 through 15 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 Columns 16 through 30 272 306 342 380 420 462 506 552 600 650 702 756 812 870 930 Columns 31 through 36 992 1056 1122 1190 1260 1332 a = Columns 1 through 15 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 Columns 16 through 30 272 306 342 380 420 462 506 552 600 650 702 756 812 870 930 Columns 31 through 37 992 1056 1122 1190 1260 1332 1406 a = Columns 1 through 15 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 Columns 16 through 30 272 306 342 380 420 462 506 552 600 650 702 756 812 870 930 Columns 31 through 38 992 1056 1122 1190 1260 1332 1406 1482 a = Columns 1 through 15 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 Columns 16 through 30 272 306 342 380 420 462 506 552 600 650 702 756 812 870 930 Columns 31 through 39 992 1056 1122 1190 1260 1332 1406 1482 1560 a = Columns 1 through 15 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 Columns 16 through 30 272 306 342 380 420 462 506 552 600 650 702 756 812 870 930 Columns 31 through 40 992 1056 1122 1190 1260 1332 1406 1482 1560 1640 a = Columns 1 through 15 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 Columns 16 through 30 272 306 342 380 420 462 506 552 600 650 702 756 812 870 930 Columns 31 through 41 992 1056 1122 1190 1260 1332 1406 1482 1560 1640 1722 a = Columns 1 through 15 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 Columns 16 through 30 272 306 342 380 420 462 506 552 600 650 702 756 812 870 930 Columns 31 through 42 992 1056 1122 1190 1260 1332 1406 1482 1560 1640 1722 1806 a = Columns 1 through 15 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 Columns 16 through 30 272 306 342 380 420 462 506 552 600 650 702 756 812 870 930 Columns 31 through 43 992 1056 1122 1190 1260 1332 1406 1482 1560 1640 1722 1806 1892 a = Columns 1 through 15 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 Columns 16 through 30 272 306 342 380 420 ...

8   Pass
n = 99; s_correct = 333300; assert(isequal(sumOfSeriesV(n),s_correct))

a = 2 a = 2 6 a = 2 6 12 a = 2 6 12 20 a = 2 6 12 20 30 a = 2 6 12 20 30 42 a = 2 6 12 20 30 42 56 a = 2 6 12 20 30 42 56 72 a = 2 6 12 20 30 42 56 72 90 a = 2 6 12 20 30 42 56 72 90 110 a = 2 6 12 20 30 42 56 72 90 110 132 a = 2 6 12 20 30 42 56 72 90 110 132 156 a = 2 6 12 20 30 42 56 72 90 110 132 156 182 a = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 a = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 a = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 a = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 a = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 342 a = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 342 380 a = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 342 380 420 a = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 342 380 420 462 a = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 342 380 420 462 506 a = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 342 380 420 462 506 552 a = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 342 380 420 462 506 552 600 a = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 342 380 420 462 506 552 600 650 a = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 342 380 420 462 506 552 600 650 702 a = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 342 380 420 462 506 552 600 650 702 756 a = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 342 380 420 462 506 552 600 650 702 756 812 a = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 342 380 420 462 506 552 600 650 702 756 812 870 a = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 342 380 420 462 506 552 600 650 702 756 812 870 930 a = Columns 1 through 30 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 342 380 420 462 506 552 600 650 702 756 812 870 930 Column 31 992 a = Columns 1 through 15 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 Columns 16 through 30 272 306 342 380 420 462 506 552 600 650 702 756 812 870 930 Columns 31 through 32 992 1056 a = Columns 1 through 15 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 Columns 16 through 30 272 306 342 380 420 462 506 552 600 650 702 756 812 870 930 Columns 31 through 33 992 1056 1122 a = Columns 1 through 15 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 Columns 16 through 30 272 306 342 380 420 462 506 552 600 650 702 756 812 870 930 Columns 31 through 34 992 1056 1122 1190 a = Columns 1 through 15 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 Columns 16 through 30 272 306 342 380 420 462 506 552 600 650 702 756 812 870 930 Columns 31 through 35 992 1056 1122 1190 1260 a = Columns 1 through 15 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 Columns 16 through 30 272 306 342 380 420 462 506 552 600 650 702 756 812 870 930 Columns 31 through 36 992 1056 1122 1190 1260 1332 a = Columns 1 through 15 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 Columns 16 through 30 272 306 342 380 420 462 506 552 600 650 702 756 812 870 930 Columns 31 through 37 992 1056 1122 1190 1260 1332 1406 a = Columns 1 through 15 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 Columns 16 through 30 272 306 342 380 420 462 506 552 600 650 702 756 812 870 930 Columns 31 through 38 992 1056 1122 1190 1260 1332 1406 1482 a = Columns 1 through 15 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 Columns 16 through 30 272 306 342 380 420 462 506 552 600 650 702 756 812 870 930 Columns 31 through 39 992 1056 1122 1190 1260 1332 1406 1482 1560 a = Columns 1 through 15 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 Columns 16 through 30 272 306 342 380 420 462 506 552 600 650 702 756 812 870 930 Columns 31 through 40 992 1056 1122 1190 1260 1332 1406 1482 1560 1640 a = Columns 1 through 15 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 Columns 16 through 30 272 306 342 380 420 462 506 552 600 650 702 756 812 870 930 Columns 31 through 41 992 1056 1122 1190 1260 1332 1406 1482 1560 1640 1722 a = Columns 1 through 15 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 Columns 16 through 30 272 306 342 380 420 462 506 552 600 650 702 756 812 870 930 Columns 31 through 42 992 1056 1122 1190 1260 1332 1406 1482 1560 1640 1722 1806 a = Columns 1 through 15 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 Columns 16 through 30 272 306 342 380 420 462 506 552 600 650 702 756 812 870 930 Columns 31 through 43 992 1056 1122 1190 1260 1332 1406 1482 1560 1640 1722 1806 1892 a = Columns 1 through 15 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 Columns 16 through 30 272 306 342 380 420 ...