Cody

Solution 1597168

Submitted on 1 Aug 2018 by Srishti Saha
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))

arr = [] append = 2 arr = 2 ans = 2

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

arr = [] append = 2 arr = 2 append = 6 arr = 2 6 append = 12 arr = 2 6 12 ans = 20

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

arr = [] append = 2 arr = 2 append = 6 arr = 2 6 append = 12 arr = 2 6 12 append = 20 arr = 2 6 12 20 ans = 40

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

arr = [] append = 2 arr = 2 append = 6 arr = 2 6 append = 12 arr = 2 6 12 append = 20 arr = 2 6 12 20 append = 30 arr = 2 6 12 20 30 append = 42 arr = 2 6 12 20 30 42 append = 56 arr = 2 6 12 20 30 42 56 append = 72 arr = 2 6 12 20 30 42 56 72 append = 90 arr = 2 6 12 20 30 42 56 72 90 append = 110 arr = 2 6 12 20 30 42 56 72 90 110 ans = 440

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

arr = [] append = 2 arr = 2 append = 6 arr = 2 6 append = 12 arr = 2 6 12 append = 20 arr = 2 6 12 20 append = 30 arr = 2 6 12 20 30 append = 42 arr = 2 6 12 20 30 42 append = 56 arr = 2 6 12 20 30 42 56 append = 72 arr = 2 6 12 20 30 42 56 72 append = 90 arr = 2 6 12 20 30 42 56 72 90 append = 110 arr = 2 6 12 20 30 42 56 72 90 110 append = 132 arr = 2 6 12 20 30 42 56 72 90 110 132 append = 156 arr = 2 6 12 20 30 42 56 72 90 110 132 156 append = 182 arr = 2 6 12 20 30 42 56 72 90 110 132 156 182 append = 210 arr = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 append = 240 arr = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 append = 272 arr = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 append = 306 arr = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 append = 342 arr = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 342 append = 380 arr = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 342 380 append = 420 arr = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 342 380 420 append = 462 arr = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 342 380 420 462 ans = 3542

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

arr = [] append = 2 arr = 2 append = 6 arr = 2 6 append = 12 arr = 2 6 12 append = 20 arr = 2 6 12 20 append = 30 arr = 2 6 12 20 30 append = 42 arr = 2 6 12 20 30 42 append = 56 arr = 2 6 12 20 30 42 56 append = 72 arr = 2 6 12 20 30 42 56 72 append = 90 arr = 2 6 12 20 30 42 56 72 90 append = 110 arr = 2 6 12 20 30 42 56 72 90 110 append = 132 arr = 2 6 12 20 30 42 56 72 90 110 132 append = 156 arr = 2 6 12 20 30 42 56 72 90 110 132 156 append = 182 arr = 2 6 12 20 30 42 56 72 90 110 132 156 182 append = 210 arr = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 append = 240 arr = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 append = 272 arr = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 append = 306 arr = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 append = 342 arr = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 342 append = 380 arr = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 342 380 append = 420 arr = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 342 380 420 append = 462 arr = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 342 380 420 462 append = 506 arr = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 342 380 420 462 506 append = 552 arr = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 342 380 420 462 506 552 append = 600 arr = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 342 380 420 462 506 552 600 append = 650 arr = 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 append = 702 arr = 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 append = 756 arr = 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 append = 812 arr = 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 append = 870 arr = 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 append = 930 arr = 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 append = 992 arr = 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 append = 1056 arr = 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 append = 1122 arr = 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 append = 1190 arr = 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 append = 1260 arr = 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 append = 1332 arr = 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 append = 1406 arr = 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 append = 1482 arr = 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 append = 1560 arr = 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 append = 1640 arr = 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 append = 1722 arr = 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 append = 1806 arr = 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 ...

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

arr = [] append = 2 arr = 2 append = 6 arr = 2 6 append = 12 arr = 2 6 12 append = 20 arr = 2 6 12 20 append = 30 arr = 2 6 12 20 30 append = 42 arr = 2 6 12 20 30 42 append = 56 arr = 2 6 12 20 30 42 56 append = 72 arr = 2 6 12 20 30 42 56 72 append = 90 arr = 2 6 12 20 30 42 56 72 90 append = 110 arr = 2 6 12 20 30 42 56 72 90 110 append = 132 arr = 2 6 12 20 30 42 56 72 90 110 132 append = 156 arr = 2 6 12 20 30 42 56 72 90 110 132 156 append = 182 arr = 2 6 12 20 30 42 56 72 90 110 132 156 182 append = 210 arr = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 append = 240 arr = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 append = 272 arr = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 append = 306 arr = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 append = 342 arr = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 342 append = 380 arr = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 342 380 append = 420 arr = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 342 380 420 append = 462 arr = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 342 380 420 462 append = 506 arr = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 342 380 420 462 506 append = 552 arr = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 342 380 420 462 506 552 append = 600 arr = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 342 380 420 462 506 552 600 append = 650 arr = 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 append = 702 arr = 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 append = 756 arr = 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 append = 812 arr = 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 append = 870 arr = 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 append = 930 arr = 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 append = 992 arr = 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 append = 1056 arr = 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 append = 1122 arr = 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 append = 1190 arr = 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 append = 1260 arr = 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 append = 1332 arr = 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 append = 1406 arr = 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 append = 1482 arr = 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 append = 1560 arr = 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 append = 1640 arr = 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 append = 1722 arr = 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 append = 1806 arr = 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 ...

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

arr = [] append = 2 arr = 2 append = 6 arr = 2 6 append = 12 arr = 2 6 12 append = 20 arr = 2 6 12 20 append = 30 arr = 2 6 12 20 30 append = 42 arr = 2 6 12 20 30 42 append = 56 arr = 2 6 12 20 30 42 56 append = 72 arr = 2 6 12 20 30 42 56 72 append = 90 arr = 2 6 12 20 30 42 56 72 90 append = 110 arr = 2 6 12 20 30 42 56 72 90 110 append = 132 arr = 2 6 12 20 30 42 56 72 90 110 132 append = 156 arr = 2 6 12 20 30 42 56 72 90 110 132 156 append = 182 arr = 2 6 12 20 30 42 56 72 90 110 132 156 182 append = 210 arr = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 append = 240 arr = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 append = 272 arr = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 append = 306 arr = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 append = 342 arr = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 342 append = 380 arr = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 342 380 append = 420 arr = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 342 380 420 append = 462 arr = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 342 380 420 462 append = 506 arr = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 342 380 420 462 506 append = 552 arr = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 342 380 420 462 506 552 append = 600 arr = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 342 380 420 462 506 552 600 append = 650 arr = 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 append = 702 arr = 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 append = 756 arr = 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 append = 812 arr = 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 append = 870 arr = 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 append = 930 arr = 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 append = 992 arr = 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 append = 1056 arr = 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 append = 1122 arr = 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 append = 1190 arr = 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 append = 1260 arr = 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 append = 1332 arr = 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 append = 1406 arr = 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 append = 1482 arr = 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 append = 1560 arr = 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 append = 1640 arr = 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 append = 1722 arr = 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 append = 1806 arr = 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 ...