Cody

Problem 2576. Sum of series II

Solution 2268878

Submitted on 10 May 2020 by Nabil Chowdhury
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 = 1; assert(isequal(sumOfSeriesII(n),s_correct))

s = 1

2   Pass
n = 2; s_correct = 10; assert(isequal(sumOfSeriesII(n),s_correct))

s = 1 s = 10

3   Pass
n = 3; s_correct = 35; assert(isequal(sumOfSeriesII(n),s_correct))

s = 1 s = 10 s = 35

4   Pass
n = 4; s_correct = 84; assert(isequal(sumOfSeriesII(n),s_correct))

s = 1 s = 10 s = 35 s = 84

5   Pass
n = 5; s_correct = 165; assert(isequal(sumOfSeriesII(n),s_correct))

s = 1 s = 10 s = 35 s = 84 s = 165

6   Pass
n = 11; s_correct = 1771; assert(isequal(sumOfSeriesII(n),s_correct))

s = 1 s = 10 s = 35 s = 84 s = 165 s = 286 s = 455 s = 680 s = 969 s = 1330 s = 1771

7   Pass
n = 42; s_correct = 98770; assert(isequal(sumOfSeriesII(n),s_correct))

s = 1 s = 10 s = 35 s = 84 s = 165 s = 286 s = 455 s = 680 s = 969 s = 1330 s = 1771 s = 2300 s = 2925 s = 3654 s = 4495 s = 5456 s = 6545 s = 7770 s = 9139 s = 10660 s = 12341 s = 14190 s = 16215 s = 18424 s = 20825 s = 23426 s = 26235 s = 29260 s = 32509 s = 35990 s = 39711 s = 43680 s = 47905 s = 52394 s = 57155 s = 62196 s = 67525 s = 73150 s = 79079 s = 85320 s = 91881 s = 98770

8   Pass
n = 71; s_correct = 477191; assert(isequal(sumOfSeriesII(n),s_correct))

s = 1 s = 10 s = 35 s = 84 s = 165 s = 286 s = 455 s = 680 s = 969 s = 1330 s = 1771 s = 2300 s = 2925 s = 3654 s = 4495 s = 5456 s = 6545 s = 7770 s = 9139 s = 10660 s = 12341 s = 14190 s = 16215 s = 18424 s = 20825 s = 23426 s = 26235 s = 29260 s = 32509 s = 35990 s = 39711 s = 43680 s = 47905 s = 52394 s = 57155 s = 62196 s = 67525 s = 73150 s = 79079 s = 85320 s = 91881 s = 98770 s = 105995 s = 113564 s = 121485 s = 129766 s = 138415 s = 147440 s = 156849 s = 166650 s = 176851 s = 187460 s = 198485 s = 209934 s = 221815 s = 234136 s = 246905 s = 260130 s = 273819 s = 287980 s = 302621 s = 317750 s = 333375 s = 349504 s = 366145 s = 383306 s = 400995 s = 419220 s = 437989 s = 457310 s = 477191

9   Pass
n = 123; s_correct = 2481115; assert(isequal(sumOfSeriesII(n),s_correct))

s = 1 s = 10 s = 35 s = 84 s = 165 s = 286 s = 455 s = 680 s = 969 s = 1330 s = 1771 s = 2300 s = 2925 s = 3654 s = 4495 s = 5456 s = 6545 s = 7770 s = 9139 s = 10660 s = 12341 s = 14190 s = 16215 s = 18424 s = 20825 s = 23426 s = 26235 s = 29260 s = 32509 s = 35990 s = 39711 s = 43680 s = 47905 s = 52394 s = 57155 s = 62196 s = 67525 s = 73150 s = 79079 s = 85320 s = 91881 s = 98770 s = 105995 s = 113564 s = 121485 s = 129766 s = 138415 s = 147440 s = 156849 s = 166650 s = 176851 s = 187460 s = 198485 s = 209934 s = 221815 s = 234136 s = 246905 s = 260130 s = 273819 s = 287980 s = 302621 s = 317750 s = 333375 s = 349504 s = 366145 s = 383306 s = 400995 s = 419220 s = 437989 s = 457310 s = 477191 s = 497640 s = 518665 s = 540274 s = 562475 s = 585276 s = 608685 s = 632710 s = 657359 s = 682640 s = 708561 s = 735130 s = 762355 s = 790244 s = 818805 s = 848046 s = 877975 s = 908600 s = 939929 s = 971970 s = 1004731 s = 1038220 s = 1072445 s = 1107414 s = 1143135 s = 1179616 s = 1216865 s = 1254890 s = 1293699 s = 1333300 s = 1373701 s = 1414910 s = 1456935 s = 1499784 s = 1543465 s = 1587986 s = 1633355 s = 1679580 s = 1726669 s = 1774630 s = 1823471 s = 1873200 s = 1923825 s = 1975354 s = 2027795 s = 2081156 s = 2135445 s = 2190670 s = 2246839 s = 2303960 s = 2362041 s = 2421090 s = 2481115

Suggested Problems

More from this Author9

Community Treasure Hunt

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

Start Hunting!