Cody

# Problem 2577. Sum of series III

Solution 1618442

Submitted on 28 Aug 2018 by Martin C.
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))

s = 1 s = 1

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

s = 1 27 s = 28

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

s = 1 27 125 343 729 s = 1225

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

s = 1 27 125 343 729 1331 2197 3375 4913 6859 s = 19900

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

s = Columns 1 through 15 1 27 125 343 729 1331 2197 3375 4913 6859 9261 12167 15625 19683 24389 Columns 16 through 30 29791 35937 42875 50653 59319 68921 79507 91125 103823 117649 132651 148877 166375 185193 205379 Columns 31 through 42 226981 250047 274625 300763 328509 357911 389017 421875 456533 493039 531441 571787 s = 6221628

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

s = Columns 1 through 15 1 27 125 343 729 1331 2197 3375 4913 6859 9261 12167 15625 19683 24389 Columns 16 through 30 29791 35937 42875 50653 59319 68921 79507 91125 103823 117649 132651 148877 166375 185193 205379 Columns 31 through 45 226981 250047 274625 300763 328509 357911 389017 421875 456533 493039 531441 571787 614125 658503 704969 Columns 46 through 60 753571 804357 857375 912673 970299 1030301 1092727 1157625 1225043 1295029 1367631 1442897 1520875 1601613 1685159 Columns 61 through 75 1771561 1860867 1953125 2048383 2146689 2248091 2352637 2460375 2571353 2685619 2803221 2924207 3048625 3176523 3307949 Columns 76 through 90 3442951 3581577 3723875 3869893 4019679 4173281 4330747 4492125 4657463 4826809 5000211 5177717 5359375 5545233 5735339 Columns 91 through 99 5929741 6128487 6331625 6539203 6751269 6967871 7189057 7414875 7645373 s = 192109401

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

s = Columns 1 through 15 1 27 125 343 729 1331 2197 3375 4913 6859 9261 12167 15625 19683 24389 Columns 16 through 30 29791 35937 42875 50653 59319 68921 79507 91125 103823 117649 132651 148877 166375 185193 205379 Columns 31 through 45 226981 250047 274625 300763 328509 357911 389017 421875 456533 493039 531441 571787 614125 658503 704969 Columns 46 through 60 753571 804357 857375 912673 970299 1030301 1092727 1157625 1225043 1295029 1367631 1442897 1520875 1601613 1685159 Columns 61 through 75 1771561 1860867 1953125 2048383 2146689 2248091 2352637 2460375 2571353 2685619 2803221 2924207 3048625 3176523 3307949 Columns 76 through 90 3442951 3581577 3723875 3869893 4019679 4173281 4330747 4492125 4657463 4826809 5000211 5177717 5359375 5545233 5735339 Columns 91 through 105 5929741 6128487 6331625 6539203 6751269 6967871 7189057 7414875 7645373 7880599 8120601 8365427 8615125 8869743 9129329 Columns 106 through 120 9393931 9663597 9938375 10218313 10503459 10793861 11089567 11390625 11697083 12008989 12326391 12649337 12977875 13312053 13651919 Columns 121 through 124 13997521 14348907 14706125 15069223 s = 472827376

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

s = Columns 1 through 15 1 27 125 343 729 1331 2197 3375 4913 6859 9261 12167 15625 19683 24389 Columns 16 through 30 29791 35937 42875 50653 59319 68921 79507 91125 103823 117649 132651 148877 166375 185193 205379 Columns 31 through 45 226981 250047 274625 300763 328509 357911 389017 421875 456533 493039 531441 571787 614125 658503 704969 Columns 46 through 60 753571 804357 857375 912673 970299 1030301 1092727 1157625 1225043 1295029 1367631 1442897 1520875 1601613 1685159 Columns 61 through 75 1771561 1860867 1953125 2048383 2146689 2248091 2352637 2460375 2571353 2685619 2803221 2924207 3048625 3176523 3307949 Columns 76 through 90 3442951 3581577 3723875 3869893 4019679 4173281 4330747 4492125 4657463 4826809 5000211 5177717 5359375 5545233 5735339 Columns 91 through 105 5929741 6128487 6331625 6539203 6751269 6967871 7189057 7414875 7645373 7880599 8120601 8365427 8615125 8869743 9129329 Columns 106 through 120 9393931 9663597 9938375 10218313 10503459 10793861 11089567 11390625 11697083 12008989 12326391 12649337 12977875 13312053 13651919 Columns 121 through 135 13997521 14348907 14706125 15069223 15438249 15813251 16194277 16581375 16974593 17373979 17779581 18191447 18609625 19034163 19465109 Columns 136 through 150 19902511 20346417 20796875 21253933 21717639 22188041 22665187 23149125 23639903 24137569 24642171 25153757 25672375 26198073 26730899 Columns 151 through 165 27270901 27818127 28372625 28934443 29503629 30080231 30664297 31255875 31855013 32461759 33076161 33698267 34328125 34965783 35611289 Columns 166 through 180 36264691 36926037 37595375 38272753 38958219 39651821 40353607 41063625 41781923 42508549 43243551 43986977 44738875 45499293 46268279 Columns 181 through 195 47045881 47832147 48627125 49430863 50243409 51064811 51895117 52734375 53582633 54439939 55306341 56181887 57066625 57960603 58863869 Columns 196 through 210 59776471 60698457 61629875 62570773 63521199 64481201 65450827 66430125 67419143 68417929 69426531 70444997 71473375 72511713 73560059 Columns 211 through 222 74618461 75686967 76765625 77854483 78953589 80062991 81182737 82312875 83453453 84604519 85766121 86938307 s = 4.8578e+09