Cody

Problem 2577. Sum of series III

Solution 2990884

Submitted on 25 Sep 2020 by Rashidunnby Ratul
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))

current_value = 1

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

current_value = 1 current_value = 27

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

current_value = 1 current_value = 27 current_value = 125 current_value = 343 current_value = 729

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

current_value = 1 current_value = 27 current_value = 125 current_value = 343 current_value = 729 current_value = 1331 current_value = 2197 current_value = 3375 current_value = 4913 current_value = 6859

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

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

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

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

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

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

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

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

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!