Cody

Solution 1817533

Submitted on 16 May 2019 by Bryan Daniels
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))

A = 1 s = 1

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

A = 1 s = 1 A = 1 9 s = 10

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

A = 1 s = 1 A = 1 9 s = 10 A = 1 9 25 s = 35

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

A = 1 s = 1 A = 1 9 s = 10 A = 1 9 25 s = 35 A = 1 9 25 49 s = 84

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

A = 1 s = 1 A = 1 9 s = 10 A = 1 9 25 s = 35 A = 1 9 25 49 s = 84 A = 1 9 25 49 81 s = 165

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

A = 1 s = 1 A = 1 9 s = 10 A = 1 9 25 s = 35 A = 1 9 25 49 s = 84 A = 1 9 25 49 81 s = 165 A = 1 9 25 49 81 121 s = 286 A = 1 9 25 49 81 121 169 s = 455 A = 1 9 25 49 81 121 169 225 s = 680 A = 1 9 25 49 81 121 169 225 289 s = 969 A = 1 9 25 49 81 121 169 225 289 361 s = 1330 A = 1 9 25 49 81 121 169 225 289 361 441 s = 1771

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

A = 1 s = 1 A = 1 9 s = 10 A = 1 9 25 s = 35 A = 1 9 25 49 s = 84 A = 1 9 25 49 81 s = 165 A = 1 9 25 49 81 121 s = 286 A = 1 9 25 49 81 121 169 s = 455 A = 1 9 25 49 81 121 169 225 s = 680 A = 1 9 25 49 81 121 169 225 289 s = 969 A = 1 9 25 49 81 121 169 225 289 361 s = 1330 A = 1 9 25 49 81 121 169 225 289 361 441 s = 1771 A = 1 9 25 49 81 121 169 225 289 361 441 529 s = 2300 A = 1 9 25 49 81 121 169 225 289 361 441 529 625 s = 2925 A = 1 9 25 49 81 121 169 225 289 361 441 529 625 729 s = 3654 A = 1 9 25 49 81 121 169 225 289 361 441 529 625 729 841 s = 4495 A = 1 9 25 49 81 121 169 225 289 361 441 529 625 729 841 961 s = 5456 A = Columns 1 through 15 1 9 25 49 81 121 169 225 289 361 441 529 625 729 841 Columns 16 through 17 961 1089 s = 6545 A = Columns 1 through 15 1 9 25 49 81 121 169 225 289 361 441 529 625 729 841 Columns 16 through 18 961 1089 1225 s = 7770 A = Columns 1 through 15 1 9 25 49 81 121 169 225 289 361 441 529 625 729 841 Columns 16 through 19 961 1089 1225 1369 s = 9139 A = Columns 1 through 15 1 9 25 49 81 121 169 225 289 361 441 529 625 729 841 Columns 16 through 20 961 1089 1225 1369 1521 s = 10660 A = Columns 1 through 15 1 9 25 49 81 121 169 225 289 361 441 529 625 729 841 Columns 16 through 21 961 1089 1225 1369 1521 1681 s = 12341 A = Columns 1 through 15 1 9 25 49 81 121 169 225 289 361 441 529 625 729 841 Columns 16 through 22 961 1089 1225 1369 1521 1681 1849 s = 14190 A = Columns 1 through 15 1 9 25 49 81 121 169 225 289 361 441 529 625 729 841 Columns 16 through 23 961 1089 1225 1369 1521 1681 1849 2025 s = 16215 A = Columns 1 through 15 1 9 25 49 81 121 169 225 289 361 441 529 625 729 841 Columns 16 through 24 961 1089 1225 1369 1521 1681 1849 2025 2209 s = 18424 A = Columns 1 through 15 1 9 25 49 81 121 169 225 289 361 441 529 625 729 841 Columns 16 through 25 961 1089 1225 1369 1521 1681 1849 2025 2209 2401 s = 20825 A = Columns 1 through 15 1 9 25 49 81 121 169 225 289 361 441 529 625 729 841 Columns 16 through 26 961 1089 1225 1369 1521 1681 1849 2025 2209 2401 2601 s = 23426 A = Columns 1 through 15 1 9 25 49 81 121 169 225 289 361 441 529 625 729 841 Columns 16 through 27 961 1089 1225 1369 1521 1681 1849 2025 2209 2401 2601 2809 s = 26235 A = Columns 1 through 15 1 9 25 49 81 121 169 225 289 361 441 529 625 729 841 Columns 16 through 28 961 1089 1225 1369 1521 1681 1849 2025 2209 2401 2601 2809 3025 s = 29260 A = Columns 1 through 15 1 9 25 49 81 121 169 225 289 361 441 529 625 729 841 Columns 16 through 29 961 1089 1225 1369 1521 1681 1849 2025 2209 2401 2601 2809 3025 3249 s = 32509 A = Columns 1 through 15 1 9 25 49 81 121 169 225 289 361 441 529 625 729 841 Columns 16 through 30 961 1089 1225 1369 1521 1681 1849 2025 2209 2401 2601 2809 3025 3249 3481 s = 35990 A = Columns 1 through 15 1 9 25 49 81 121 169 225 289 361 441 529 625 729 841 Columns 16 through 30 961 1089 1225 1369 1521 1681 1849 2025 2209 2401 2601 2809 3025 3249 3481 Column 31 3721 s = 39711 A = Columns 1 through 15 1 9 25 49 81 121 169 225 289 361 441 529 625 729 841 Columns 16 through 30 961 1089 1225 1369 1521 1681 1849 2025 2209 2401 2601 2809 3025 3249 3481 Columns 31 through 32 3721 3969 s = 43680 A = Columns 1 through 15 1 9 25 49 81 121 169 225 289 361 441 529 625 729 841 Columns 16 through 30 961 1089 1225 1369 1521 1681 1849 2025 2209 2401 2601 2809 3025 3249 3481 Columns 31 through 33 3721 3969 4225 s = 47905 A = Columns 1 through 15 1 9 25 49 81 121 169 225 289 361 441 529 625 729 841 Columns 16 through 30 961 1089 1225 1369 1521 1681 1849 2025 2209 2401 2601 2809 3025 3249 3481 Columns 31 through 34 3721 3969 4225 4489 s = 52394 A = Columns 1 through 15 1 9 25 49 81 121 169 225 289 361 441 529 625 729 841 Columns 16 through 30 961 1089 1225 1369 1521 1681 1849 2025 2209 2401 2601 2809 3025 3249 3481 Columns 31 through 35 3721 3969 4225 4489 4761 s = 57155 A = Columns 1 through 15 1 9 25 49 81 121 169 225 289 361 441 529 625 729 841 Columns 16 through 30 961 1089 1225 1369 1521 1681 1849 2025 2209 2401 2601 2809 3025 3249 3481 Columns 31 through 36 3721 3969 4225 4489 4761 5041 s = 62196 A = Columns 1 through 15 1 9 25 49 81 121 169 225 289 361 441 529 625 729 841 Columns 16 through 30 961 1089 1225 1369 1521 1681 1849 2025 2209 2401 2601 2809 3025 3249 3481 Columns 31 through 37 3721 3969 4225 4489 4761 5041 5329 s = 67525 A = Columns 1 through 15 1 9 25 49 81 121 169 225 289 361 ...

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

A = 1 s = 1 A = 1 9 s = 10 A = 1 9 25 s = 35 A = 1 9 25 49 s = 84 A = 1 9 25 49 81 s = 165 A = 1 9 25 49 81 121 s = 286 A = 1 9 25 49 81 121 169 s = 455 A = 1 9 25 49 81 121 169 225 s = 680 A = 1 9 25 49 81 121 169 225 289 s = 969 A = 1 9 25 49 81 121 169 225 289 361 s = 1330 A = 1 9 25 49 81 121 169 225 289 361 441 s = 1771 A = 1 9 25 49 81 121 169 225 289 361 441 529 s = 2300 A = 1 9 25 49 81 121 169 225 289 361 441 529 625 s = 2925 A = 1 9 25 49 81 121 169 225 289 361 441 529 625 729 s = 3654 A = 1 9 25 49 81 121 169 225 289 361 441 529 625 729 841 s = 4495 A = 1 9 25 49 81 121 169 225 289 361 441 529 625 729 841 961 s = 5456 A = Columns 1 through 15 1 9 25 49 81 121 169 225 289 361 441 529 625 729 841 Columns 16 through 17 961 1089 s = 6545 A = Columns 1 through 15 1 9 25 49 81 121 169 225 289 361 441 529 625 729 841 Columns 16 through 18 961 1089 1225 s = 7770 A = Columns 1 through 15 1 9 25 49 81 121 169 225 289 361 441 529 625 729 841 Columns 16 through 19 961 1089 1225 1369 s = 9139 A = Columns 1 through 15 1 9 25 49 81 121 169 225 289 361 441 529 625 729 841 Columns 16 through 20 961 1089 1225 1369 1521 s = 10660 A = Columns 1 through 15 1 9 25 49 81 121 169 225 289 361 441 529 625 729 841 Columns 16 through 21 961 1089 1225 1369 1521 1681 s = 12341 A = Columns 1 through 15 1 9 25 49 81 121 169 225 289 361 441 529 625 729 841 Columns 16 through 22 961 1089 1225 1369 1521 1681 1849 s = 14190 A = Columns 1 through 15 1 9 25 49 81 121 169 225 289 361 441 529 625 729 841 Columns 16 through 23 961 1089 1225 1369 1521 1681 1849 2025 s = 16215 A = Columns 1 through 15 1 9 25 49 81 121 169 225 289 361 441 529 625 729 841 Columns 16 through 24 961 1089 1225 1369 1521 1681 1849 2025 2209 s = 18424 A = Columns 1 through 15 1 9 25 49 81 121 169 225 289 361 441 529 625 729 841 Columns 16 through 25 961 1089 1225 1369 1521 1681 1849 2025 2209 2401 s = 20825 A = Columns 1 through 15 1 9 25 49 81 121 169 225 289 361 441 529 625 729 841 Columns 16 through 26 961 1089 1225 1369 1521 1681 1849 2025 2209 2401 2601 s = 23426 A = Columns 1 through 15 1 9 25 49 81 121 169 225 289 361 441 529 625 729 841 Columns 16 through 27 961 1089 1225 1369 1521 1681 1849 2025 2209 2401 2601 2809 s = 26235 A = Columns 1 through 15 1 9 25 49 81 121 169 225 289 361 441 529 625 729 841 Columns 16 through 28 961 1089 1225 1369 1521 1681 1849 2025 2209 2401 2601 2809 3025 s = 29260 A = Columns 1 through 15 1 9 25 49 81 121 169 225 289 361 441 529 625 729 841 Columns 16 through 29 961 1089 1225 1369 1521 1681 1849 2025 2209 2401 2601 2809 3025 3249 s = 32509 A = Columns 1 through 15 1 9 25 49 81 121 169 225 289 361 441 529 625 729 841 Columns 16 through 30 961 1089 1225 1369 1521 1681 1849 2025 2209 2401 2601 2809 3025 3249 3481 s = 35990 A = Columns 1 through 15 1 9 25 49 81 121 169 225 289 361 441 529 625 729 841 Columns 16 through 30 961 1089 1225 1369 1521 1681 1849 2025 2209 2401 2601 2809 3025 3249 3481 Column 31 3721 s = 39711 A = Columns 1 through 15 1 9 25 49 81 121 169 225 289 361 441 529 625 729 841 Columns 16 through 30 961 1089 1225 1369 1521 1681 1849 2025 2209 2401 2601 2809 3025 3249 3481 Columns 31 through 32 3721 3969 s = 43680 A = Columns 1 through 15 1 9 25 49 81 121 169 225 289 361 441 529 625 729 841 Columns 16 through 30 961 1089 1225 1369 1521 1681 1849 2025 2209 2401 2601 2809 3025 3249 3481 Columns 31 through 33 3721 3969 4225 s = 47905 A = Columns 1 through 15 1 9 25 49 81 121 169 225 289 361 441 529 625 729 841 Columns 16 through 30 961 1089 1225 1369 1521 1681 1849 2025 2209 2401 2601 2809 3025 3249 3481 Columns 31 through 34 3721 3969 4225 4489 s = 52394 A = Columns 1 through 15 1 9 25 49 81 121 169 225 289 361 441 529 625 729 841 Columns 16 through 30 961 1089 1225 1369 1521 1681 1849 2025 2209 2401 2601 2809 3025 3249 3481 Columns 31 through 35 3721 3969 4225 4489 4761 s = 57155 A = Columns 1 through 15 1 9 25 49 81 121 169 225 289 361 441 529 625 729 841 Columns 16 through 30 961 1089 1225 1369 1521 1681 1849 2025 2209 2401 2601 2809 3025 3249 3481 Columns 31 through 36 3721 3969 4225 4489 4761 5041 s = 62196 A = Columns 1 through 15 1 9 25 49 81 121 169 225 289 361 441 529 625 729 841 Columns 16 through 30 961 1089 1225 1369 1521 1681 1849 2025 2209 2401 2601 2809 3025 3249 3481 Columns 31 through 37 3721 3969 4225 4489 4761 5041 5329 s = 67525 A = Columns 1 through 15 1 9 25 49 81 121 169 225 289 361 ...

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

A = 1 s = 1 A = 1 9 s = 10 A = 1 9 25 s = 35 A = 1 9 25 49 s = 84 A = 1 9 25 49 81 s = 165 A = 1 9 25 49 81 121 s = 286 A = 1 9 25 49 81 121 169 s = 455 A = 1 9 25 49 81 121 169 225 s = 680 A = 1 9 25 49 81 121 169 225 289 s = 969 A = 1 9 25 49 81 121 169 225 289 361 s = 1330 A = 1 9 25 49 81 121 169 225 289 361 441 s = 1771 A = 1 9 25 49 81 121 169 225 289 361 441 529 s = 2300 A = 1 9 25 49 81 121 169 225 289 361 441 529 625 s = 2925 A = 1 9 25 49 81 121 169 225 289 361 441 529 625 729 s = 3654 A = 1 9 25 49 81 121 169 225 289 361 441 529 625 729 841 s = 4495 A = 1 9 25 49 81 121 169 225 289 361 441 529 625 729 841 961 s = 5456 A = Columns 1 through 15 1 9 25 49 81 121 169 225 289 361 441 529 625 729 841 Columns 16 through 17 961 1089 s = 6545 A = Columns 1 through 15 1 9 25 49 81 121 169 225 289 361 441 529 625 729 841 Columns 16 through 18 961 1089 1225 s = 7770 A = Columns 1 through 15 1 9 25 49 81 121 169 225 289 361 441 529 625 729 841 Columns 16 through 19 961 1089 1225 1369 s = 9139 A = Columns 1 through 15 1 9 25 49 81 121 169 225 289 361 441 529 625 729 841 Columns 16 through 20 961 1089 1225 1369 1521 s = 10660 A = Columns 1 through 15 1 9 25 49 81 121 169 225 289 361 441 529 625 729 841 Columns 16 through 21 961 1089 1225 1369 1521 1681 s = 12341 A = Columns 1 through 15 1 9 25 49 81 121 169 225 289 361 441 529 625 729 841 Columns 16 through 22 961 1089 1225 1369 1521 1681 1849 s = 14190 A = Columns 1 through 15 1 9 25 49 81 121 169 225 289 361 441 529 625 729 841 Columns 16 through 23 961 1089 1225 1369 1521 1681 1849 2025 s = 16215 A = Columns 1 through 15 1 9 25 49 81 121 169 225 289 361 441 529 625 729 841 Columns 16 through 24 961 1089 1225 1369 1521 1681 1849 2025 2209 s = 18424 A = Columns 1 through 15 1 9 25 49 81 121 169 225 289 361 441 529 625 729 841 Columns 16 through 25 961 1089 1225 1369 1521 1681 1849 2025 2209 2401 s = 20825 A = Columns 1 through 15 1 9 25 49 81 121 169 225 289 361 441 529 625 729 841 Columns 16 through 26 961 1089 1225 1369 1521 1681 1849 2025 2209 2401 2601 s = 23426 A = Columns 1 through 15 1 9 25 49 81 121 169 225 289 361 441 529 625 729 841 Columns 16 through 27 961 1089 1225 1369 1521 1681 1849 2025 2209 2401 2601 2809 s = 26235 A = Columns 1 through 15 1 9 25 49 81 121 169 225 289 361 441 529 625 729 841 Columns 16 through 28 961 1089 1225 1369 1521 1681 1849 2025 2209 2401 2601 2809 3025 s = 29260 A = Columns 1 through 15 1 9 25 49 81 121 169 225 289 361 441 529 625 729 841 Columns 16 through 29 961 1089 1225 1369 1521 1681 1849 2025 2209 2401 2601 2809 3025 3249 s = 32509 A = Columns 1 through 15 1 9 25 49 81 121 169 225 289 361 441 529 625 729 841 Columns 16 through 30 961 1089 1225 1369 1521 1681 1849 2025 2209 2401 2601 2809 3025 3249 3481 s = 35990 A = Columns 1 through 15 1 9 25 49 81 121 169 225 289 361 441 529 625 729 841 Columns 16 through 30 961 1089 1225 1369 1521 1681 1849 2025 2209 2401 2601 2809 3025 3249 3481 Column 31 3721 s = 39711 A = Columns 1 through 15 1 9 25 49 81 121 169 225 289 361 441 529 625 729 841 Columns 16 through 30 961 1089 1225 1369 1521 1681 1849 2025 2209 2401 2601 2809 3025 3249 3481 Columns 31 through 32 3721 3969 s = 43680 A = Columns 1 through 15 1 9 25 49 81 121 169 225 289 361 441 529 625 729 841 Columns 16 through 30 961 1089 1225 1369 1521 1681 1849 2025 2209 2401 2601 2809 3025 3249 3481 Columns 31 through 33 3721 3969 4225 s = 47905 A = Columns 1 through 15 1 9 25 49 81 121 169 225 289 361 441 529 625 729 841 Columns 16 through 30 961 1089 1225 1369 1521 1681 1849 2025 2209 2401 2601 2809 3025 3249 3481 Columns 31 through 34 3721 3969 4225 4489 s = 52394 A = Columns 1 through 15 1 9 25 49 81 121 169 225 289 361 441 529 625 729 841 Columns 16 through 30 961 1089 1225 1369 1521 1681 1849 2025 2209 2401 2601 2809 3025 3249 3481 Columns 31 through 35 3721 3969 4225 4489 4761 s = 57155 A = Columns 1 through 15 1 9 25 49 81 121 169 225 289 361 441 529 625 729 841 Columns 16 through 30 961 1089 1225 1369 1521 1681 1849 2025 2209 2401 2601 2809 3025 3249 3481 Columns 31 through 36 3721 3969 4225 4489 4761 5041 s = 62196 A = Columns 1 through 15 1 9 25 49 81 121 169 225 289 361 441 529 625 729 841 Columns 16 through 30 961 1089 1225 1369 1521 1681 1849 2025 2209 2401 2601 2809 3025 3249 3481 Columns 31 through 37 3721 3969 4225 4489 4761 5041 5329 s = 67525 A = Columns 1 through 15 1 9 25 49 81 121 169 225 289 361 ...

Suggested Problems

More from this Author9