Cody

# Problem 2578. Sum of series IV

Solution 1817538

Submitted on 16 May 2019 by H00 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(sumOfSeriesIV(n),s_correct))

A = 1

2   Pass
n = 2; s_correct = -8; assert(isequal(sumOfSeriesIV(n),s_correct))

A = 1 A = 1 -9

3   Pass
n = 3; s_correct = 17; assert(isequal(sumOfSeriesIV(n),s_correct))

A = 1 A = 1 -9 A = 1 -9 25

4   Pass
n = 4; s_correct = -32; assert(isequal(sumOfSeriesIV(n),s_correct))

A = 1 A = 1 -9 A = 1 -9 25 A = 1 -9 25 -49

5   Pass
n = 7; s_correct = 97; assert(isequal(sumOfSeriesIV(n),s_correct))

A = 1 A = 1 -9 A = 1 -9 25 A = 1 -9 25 -49 A = 1 -9 25 -49 81 A = 1 -9 25 -49 81 -121 A = 1 -9 25 -49 81 -121 169

6   Pass
n = 12; s_correct = -288; assert(isequal(sumOfSeriesIV(n),s_correct))

A = 1 A = 1 -9 A = 1 -9 25 A = 1 -9 25 -49 A = 1 -9 25 -49 81 A = 1 -9 25 -49 81 -121 A = 1 -9 25 -49 81 -121 169 A = 1 -9 25 -49 81 -121 169 -225 A = 1 -9 25 -49 81 -121 169 -225 289 A = 1 -9 25 -49 81 -121 169 -225 289 -361 A = 1 -9 25 -49 81 -121 169 -225 289 -361 441 A = 1 -9 25 -49 81 -121 169 -225 289 -361 441 -529

7   Pass
n = 33; s_correct = 2177; assert(isequal(sumOfSeriesIV(n),s_correct))

A = 1 A = 1 -9 A = 1 -9 25 A = 1 -9 25 -49 A = 1 -9 25 -49 81 A = 1 -9 25 -49 81 -121 A = 1 -9 25 -49 81 -121 169 A = 1 -9 25 -49 81 -121 169 -225 A = 1 -9 25 -49 81 -121 169 -225 289 A = 1 -9 25 -49 81 -121 169 -225 289 -361 A = 1 -9 25 -49 81 -121 169 -225 289 -361 441 A = 1 -9 25 -49 81 -121 169 -225 289 -361 441 -529 A = 1 -9 25 -49 81 -121 169 -225 289 -361 441 -529 625 A = 1 -9 25 -49 81 -121 169 -225 289 -361 441 -529 625 -729 A = 1 -9 25 -49 81 -121 169 -225 289 -361 441 -529 625 -729 841 A = 1 -9 25 -49 81 -121 169 -225 289 -361 441 -529 625 -729 841 -961 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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

8   Pass
n = 59; s_correct = 6961; assert(isequal(sumOfSeriesIV(n),s_correct))

A = 1 A = 1 -9 A = 1 -9 25 A = 1 -9 25 -49 A = 1 -9 25 -49 81 A = 1 -9 25 -49 81 -121 A = 1 -9 25 -49 81 -121 169 A = 1 -9 25 -49 81 -121 169 -225 A = 1 -9 25 -49 81 -121 169 -225 289 A = 1 -9 25 -49 81 -121 169 -225 289 -361 A = 1 -9 25 -49 81 -121 169 -225 289 -361 441 A = 1 -9 25 -49 81 -121 169 -225 289 -361 441 -529 A = 1 -9 25 -49 81 -121 169 -225 289 -361 441 -529 625 A = 1 -9 25 -49 81 -121 169 -225 289 -361 441 -529 625 -729 A = 1 -9 25 -49 81 -121 169 -225 289 -361 441 -529 625 -729 841 A = 1 -9 25 -49 81 -121 169 -225 289 -361 441 -529 625 -729 841 -961 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 38 3721 -3969 4225 -4489 4761 -5041 5329 -5625 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 -15...