Cody

Problem 2579. Sum of series V

Solution 1720262

Submitted on 4 Feb 2019 by Nikolaos Nikolaou
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))

t = 2 s = 2

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

t = 2 t = 2 6 t = 2 6 12 s = 20

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

t = 2 t = 2 6 t = 2 6 12 t = 2 6 12 20 s = 40

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

t = 2 t = 2 6 t = 2 6 12 t = 2 6 12 20 t = 2 6 12 20 30 t = 2 6 12 20 30 42 t = 2 6 12 20 30 42 56 t = 2 6 12 20 30 42 56 72 t = 2 6 12 20 30 42 56 72 90 t = 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))

t = 2 t = 2 6 t = 2 6 12 t = 2 6 12 20 t = 2 6 12 20 30 t = 2 6 12 20 30 42 t = 2 6 12 20 30 42 56 t = 2 6 12 20 30 42 56 72 t = 2 6 12 20 30 42 56 72 90 t = 2 6 12 20 30 42 56 72 90 110 t = 2 6 12 20 30 42 56 72 90 110 132 t = 2 6 12 20 30 42 56 72 90 110 132 156 t = 2 6 12 20 30 42 56 72 90 110 132 156 182 t = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 t = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 t = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 t = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 t = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 342 t = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 342 380 t = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 342 380 420 t = 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))

t = 2 t = 2 6 t = 2 6 12 t = 2 6 12 20 t = 2 6 12 20 30 t = 2 6 12 20 30 42 t = 2 6 12 20 30 42 56 t = 2 6 12 20 30 42 56 72 t = 2 6 12 20 30 42 56 72 90 t = 2 6 12 20 30 42 56 72 90 110 t = 2 6 12 20 30 42 56 72 90 110 132 t = 2 6 12 20 30 42 56 72 90 110 132 156 t = 2 6 12 20 30 42 56 72 90 110 132 156 182 t = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 t = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 t = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 t = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 t = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 342 t = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 342 380 t = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 342 380 420 t = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 342 380 420 462 t = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 342 380 420 462 506 t = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 342 380 420 462 506 552 t = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 342 380 420 462 506 552 600 t = 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 t = 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 t = 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 t = 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 t = 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 t = 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 t = 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 t = 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 t = 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 t = 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 t = 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 t = 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 t = 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 t = 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 t = 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 t = 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 t = 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 t = 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))

t = 2 t = 2 6 t = 2 6 12 t = 2 6 12 20 t = 2 6 12 20 30 t = 2 6 12 20 30 42 t = 2 6 12 20 30 42 56 t = 2 6 12 20 30 42 56 72 t = 2 6 12 20 30 42 56 72 90 t = 2 6 12 20 30 42 56 72 90 110 t = 2 6 12 20 30 42 56 72 90 110 132 t = 2 6 12 20 30 42 56 72 90 110 132 156 t = 2 6 12 20 30 42 56 72 90 110 132 156 182 t = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 t = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 t = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 t = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 t = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 342 t = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 342 380 t = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 342 380 420 t = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 342 380 420 462 t = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 342 380 420 462 506 t = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 342 380 420 462 506 552 t = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 342 380 420 462 506 552 600 t = 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 t = 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 t = 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 t = 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 t = 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 t = 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 t = 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 t = 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 t = 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 t = 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 t = 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 t = 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 t = 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 t = 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 t = 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 t = 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 t = 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 t = 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 t = 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 t = 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))

t = 2 t = 2 6 t = 2 6 12 t = 2 6 12 20 t = 2 6 12 20 30 t = 2 6 12 20 30 42 t = 2 6 12 20 30 42 56 t = 2 6 12 20 30 42 56 72 t = 2 6 12 20 30 42 56 72 90 t = 2 6 12 20 30 42 56 72 90 110 t = 2 6 12 20 30 42 56 72 90 110 132 t = 2 6 12 20 30 42 56 72 90 110 132 156 t = 2 6 12 20 30 42 56 72 90 110 132 156 182 t = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 t = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 t = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 t = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 t = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 342 t = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 342 380 t = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 342 380 420 t = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 342 380 420 462 t = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 342 380 420 462 506 t = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 342 380 420 462 506 552 t = 2 6 12 20 30 42 56 72 90 110 132 156 182 210 240 272 306 342 380 420 462 506 552 600 t = 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 t = 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 t = 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 t = 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 t = 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 t = 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 t = 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 t = 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 t = 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 t = 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 t = 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 t = 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 t = 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 t = 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 t = 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 t = 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 t = 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 t = 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 t = 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 t = 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 ...

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!