Cody

Problem 2577. Sum of series III

Solution 3199076

Submitted on 13 Oct 2020 by ivan fernandez
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(sumOfSeriesIII(n),s_correct))

sum = 0 sum = 1 s = 1

2   Pass
n = 2; s_correct = 28; assert(isequal(sumOfSeriesIII(n),s_correct))

sum = 0 sum = 1 sum = 28 s = 28

3   Pass
n = 5; s_correct = 1225; assert(isequal(sumOfSeriesIII(n),s_correct))

sum = 0 sum = 1 sum = 28 sum = 153 sum = 496 sum = 1225 s = 1225

4   Pass
n = 10; s_correct = 19900; assert(isequal(sumOfSeriesIII(n),s_correct))

sum = 0 sum = 1 sum = 28 sum = 153 sum = 496 sum = 1225 sum = 2556 sum = 4753 sum = 8128 sum = 13041 sum = 19900 s = 19900

5   Pass
n = 42; s_correct = 6221628; assert(isequal(sumOfSeriesIII(n),s_correct))

sum = 0 sum = 1 sum = 28 sum = 153 sum = 496 sum = 1225 sum = 2556 sum = 4753 sum = 8128 sum = 13041 sum = 19900 sum = 29161 sum = 41328 sum = 56953 sum = 76636 sum = 101025 sum = 130816 sum = 166753 sum = 209628 sum = 260281 sum = 319600 sum = 388521 sum = 468028 sum = 559153 sum = 662976 sum = 780625 sum = 913276 sum = 1062153 sum = 1228528 sum = 1413721 sum = 1619100 sum = 1846081 sum = 2096128 sum = 2370753 sum = 2671516 sum = 3000025 sum = 3357936 sum = 3746953 sum = 4168828 sum = 4625361 sum = 5118400 sum = 5649841 sum = 6221628 s = 6221628

6   Pass
n = 99; s_correct = 192109401; assert(isequal(sumOfSeriesIII(n),s_correct))

sum = 0 sum = 1 sum = 28 sum = 153 sum = 496 sum = 1225 sum = 2556 sum = 4753 sum = 8128 sum = 13041 sum = 19900 sum = 29161 sum = 41328 sum = 56953 sum = 76636 sum = 101025 sum = 130816 sum = 166753 sum = 209628 sum = 260281 sum = 319600 sum = 388521 sum = 468028 sum = 559153 sum = 662976 sum = 780625 sum = 913276 sum = 1062153 sum = 1228528 sum = 1413721 sum = 1619100 sum = 1846081 sum = 2096128 sum = 2370753 sum = 2671516 sum = 3000025 sum = 3357936 sum = 3746953 sum = 4168828 sum = 4625361 sum = 5118400 sum = 5649841 sum = 6221628 sum = 6835753 sum = 7494256 sum = 8199225 sum = 8952796 sum = 9757153 sum = 10614528 sum = 11527201 sum = 12497500 sum = 13527801 sum = 14620528 sum = 15778153 sum = 17003196 sum = 18298225 sum = 19665856 sum = 21108753 sum = 22629628 sum = 24231241 sum = 25916400 sum = 27687961 sum = 29548828 sum = 31501953 sum = 33550336 sum = 35697025 sum = 37945116 sum = 40297753 sum = 42758128 sum = 45329481 sum = 48015100 sum = 50818321 sum = 53742528 sum = 56791153 sum = 59967676 sum = 63275625 sum = 66718576 sum = 70300153 sum = 74024028 sum = 77893921 sum = 81913600 sum = 86086881 sum = 90417628 sum = 94909753 sum = 99567216 sum = 104394025 sum = 109394236 sum = 114571953 sum = 119931328 sum = 125476561 sum = 131211900 sum = 137141641 sum = 143270128 sum = 149601753 sum = 156140956 sum = 162892225 sum = 169860096 sum = 177049153 sum = 184464028 sum = 192109401 s = 192109401

7   Pass
n = 124; s_correct = 472827376; assert(isequal(sumOfSeriesIII(n),s_correct))

sum = 0 sum = 1 sum = 28 sum = 153 sum = 496 sum = 1225 sum = 2556 sum = 4753 sum = 8128 sum = 13041 sum = 19900 sum = 29161 sum = 41328 sum = 56953 sum = 76636 sum = 101025 sum = 130816 sum = 166753 sum = 209628 sum = 260281 sum = 319600 sum = 388521 sum = 468028 sum = 559153 sum = 662976 sum = 780625 sum = 913276 sum = 1062153 sum = 1228528 sum = 1413721 sum = 1619100 sum = 1846081 sum = 2096128 sum = 2370753 sum = 2671516 sum = 3000025 sum = 3357936 sum = 3746953 sum = 4168828 sum = 4625361 sum = 5118400 sum = 5649841 sum = 6221628 sum = 6835753 sum = 7494256 sum = 8199225 sum = 8952796 sum = 9757153 sum = 10614528 sum = 11527201 sum = 12497500 sum = 13527801 sum = 14620528 sum = 15778153 sum = 17003196 sum = 18298225 sum = 19665856 sum = 21108753 sum = 22629628 sum = 24231241 sum = 25916400 sum = 27687961 sum = 29548828 sum = 31501953 sum = 33550336 sum = 35697025 sum = 37945116 sum = 40297753 sum = 42758128 sum = 45329481 sum = 48015100 sum = 50818321 sum = 53742528 sum = 56791153 sum = 59967676 sum = 63275625 sum = 66718576 sum = 70300153 sum = 74024028 sum = 77893921 sum = 81913600 sum = 86086881 sum = 90417628 sum = 94909753 sum = 99567216 sum = 104394025 sum = 109394236 sum = 114571953 sum = 119931328 sum = 125476561 sum = 131211900 sum = 137141641 sum = 143270128 sum = 149601753 sum = 156140956 sum = 162892225 sum = 169860096 sum = 177049153 sum = 184464028 sum = 192109401 sum = 199990000 sum = 208110601 sum = 216476028 sum = 225091153 sum = 233960896 sum = 243090225 sum = 252484156 sum = 262147753 sum = 272086128 sum = 282304441 sum = 292807900 sum = 303601761 sum = 314691328 sum = 326081953 sum = 337779036 sum = 349788025 sum = 362114416 sum = 374763753 sum = 387741628 sum = 401053681 sum = 414705600 sum = 428703121 sum = 443052028 sum = 457758153 sum = 472827376 s = 472827376

8   Pass
n = 222; s_correct = 4857776028; assert(isequal(sumOfSeriesIII(n),s_correct))

sum = 0 sum = 1 sum = 28 sum = 153 sum = 496 sum = 1225 sum = 2556 sum = 4753 sum = 8128 sum = 13041 sum = 19900 sum = 29161 sum = 41328 sum = 56953 sum = 76636 sum = 101025 sum = 130816 sum = 166753 sum = 209628 sum = 260281 sum = 319600 sum = 388521 sum = 468028 sum = 559153 sum = 662976 sum = 780625 sum = 913276 sum = 1062153 sum = 1228528 sum = 1413721 sum = 1619100 sum = 1846081 sum = 2096128 sum = 2370753 sum = 2671516 sum = 3000025 sum = 3357936 sum = 3746953 sum = 4168828 sum = 4625361 sum = 5118400 sum = 5649841 sum = 6221628 sum = 6835753 sum = 7494256 sum = 8199225 sum = 8952796 sum = 9757153 sum = 10614528 sum = 11527201 sum = 12497500 sum = 13527801 sum = 14620528 sum = 15778153 sum = 17003196 sum = 18298225 sum = 19665856 sum = 21108753 sum = 22629628 sum = 24231241 sum = 25916400 sum = 27687961 sum = 29548828 sum = 31501953 sum = 33550336 sum = 35697025 sum = 37945116 sum = 40297753 sum = 42758128 sum = 45329481 sum = 48015100 sum = 50818321 sum = 53742528 sum = 56791153 sum = 59967676 sum = 63275625 sum = 66718576 sum = 70300153 sum = 74024028 sum = 77893921 sum = 81913600 sum = 86086881 sum = 90417628 sum = 94909753 sum = 99567216 sum = 104394025 sum = 109394236 sum = 114571953 sum = 119931328 sum = 125476561 sum = 131211900 sum = 137141641 sum = 143270128 sum = 149601753 sum = 156140956 sum = 162892225 sum = 169860096 sum = 177049153 sum = 184464028 sum = 192109401 sum = 199990000 sum = 208110601 sum = 216476028 sum = 225091153 sum = 233960896 sum = 243090225 sum = 252484156 sum = 262147753 sum = 272086128 sum = 282304441 sum = 292807900 sum = 303601761 sum = 314691328 sum = 326081953 sum = 337779036 sum = 349788025 sum = 362114416 sum = 374763753 sum = 387741628 sum = 401053681 sum = 414705600 sum = 428703121 sum = 443052028 sum = 457758153 sum = 472827376 sum = 488265625 sum = 504078876 sum = 520273153 sum = 536854528 sum = 553829121 sum = 571203100 sum = 588982681 sum = 607174128 sum = 625783753 sum = 644817916 sum = 664283025 sum = 684185536 sum = 704531953 sum = 725328828 sum = 746582761 sum = 768300400 sum = 790488441 sum = 813153628 sum = 836302753 sum = 859942656 sum = 884080225 sum = 908722396 sum = 933876153 sum = 959548528 sum = 985746601 sum = 1.0125e+09 sum = 1.0397e+09 sum = 1.0676e+09 sum = 1.0959e+09 sum = 1.1249e+09 sum = 1.1544e+09 sum = 1.1845e+09 sum = 1.2151e+09 sum = 1.2464e+09 sum = 1.2782e+09 sum = 1.3107e+09 sum = 1.3438e+09 sum = 1.3775e+09 sum = 1.4118e+09 sum = 1.4468e+09 sum = 1.4824e+09 sum = 1.5186e+09 sum = 1.5556e+09 sum = 1.5932e+09 sum = 1.6314e+09 sum = 1.6704e+09 sum = 1.7100e+09 sum = 1.7504e+09 sum = 1.7915e+09 sum = 1.8332e+09 sum = 1.8758e+09 sum = 1.9190e+09 sum = 1.9630e+09 sum = 2.0077e+09 sum = 2.0532e+09 sum = 2.0995e+09 sum = 2.1465e+09 sum = 2.1944e+09 sum = 2.2430e+09 sum = 2.2924e+09 sum = 2.3427e+09 sum = 2.3937e+09 sum = 2.4456e+09 sum = 2.4984e+09 sum = 2.5519e+09 sum = 2.6064e+09 sum = 2.6617e+09 sum = 2.7179e+09 sum = 2.7749e+09 sum = 2.8329e+09 sum = 2.8918e+09 sum = 2.9515e+09 sum = 3.0122e+09 sum = 3.0739e+09 sum = 3.1364e+09 sum = 3.2000e+09 sum = 3.2644e+09 sum = 3.3299e+09 sum = 3.3963e+09 sum = 3.4637e+09 sum = 3.5322e+09 sum = 3.6016e+09 sum = 3.6720e+09 sum = 3.7435e+09 sum = 3.8160e+09 sum = 3.8896e+09 sum = 3.9642e+09 sum = 4.0399e+09 sum = 4.1166e+09 sum = 4.1945e+09 sum = 4.2735e+09 sum = 4.3535e+09 sum = 4.4347e+09 sum = 4.5170e+09 sum = 4.6005e+09 sum = 4.6851e+09 sum = 4.7708e+09 sum = 4.8578e+09 s = 4.8578e+09

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!