Cody

Solution 1934122

Submitted on 13 Sep 2019
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))

k = 1

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

k = 1 k = -8

Assertion failed.

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

k = 1 k = -8 k = 17

Assertion failed.

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

k = 1 k = -8 k = 17 k = -32

Assertion failed.

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

k = 1 k = -8 k = 17 k = -32 k = 49 k = -72 k = 97

Assertion failed.

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

k = 1 k = -8 k = 17 k = -32 k = 49 k = -72 k = 97 k = -128 k = 161 k = -200 k = 241 k = -288

Assertion failed.

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

k = 1 k = -8 k = 17 k = -32 k = 49 k = -72 k = 97 k = -128 k = 161 k = -200 k = 241 k = -288 k = 337 k = -392 k = 449 k = -512 k = 577 k = -648 k = 721 k = -800 k = 881 k = -968 k = 1057 k = -1152 k = 1249 k = -1352 k = 1457 k = -1568 k = 1681 k = -1800 k = 1921 k = -2048 k = 2177

Assertion failed.

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

k = 1 k = -8 k = 17 k = -32 k = 49 k = -72 k = 97 k = -128 k = 161 k = -200 k = 241 k = -288 k = 337 k = -392 k = 449 k = -512 k = 577 k = -648 k = 721 k = -800 k = 881 k = -968 k = 1057 k = -1152 k = 1249 k = -1352 k = 1457 k = -1568 k = 1681 k = -1800 k = 1921 k = -2048 k = 2177 k = -2312 k = 2449 k = -2592 k = 2737 k = -2888 k = 3041 k = -3200 k = 3361 k = -3528 k = 3697 k = -3872 k = 4049 k = -4232 k = 4417 k = -4608 k = 4801 k = -5000 k = 5201 k = -5408 k = 5617 k = -5832 k = 6049 k = -6272 k = 6497 k = -6728 k = 6961

Assertion failed.

Suggested Problems

More from this Author9