Cody

# Problem 44845. Just another sum (JAS)

Solution 1727273

Submitted on 14 Feb 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   Fail
x=[ 1.000000000000 2.000000000000 3.000000000000 4.000000000000 5.000000000000 6.000000000000 7.000000000000 8.000000000000 9.000000000000 10.000000000000 ]; y=sol(x); yref=-5.000000000000 assert(abs(y-yref)<1e-6);

yref = -5

Error using assert The condition input argument must be a scalar logical. Error in Test1 (line 4) assert(abs(y-yref)<1e-6);

2   Fail
x=[ 2.000000000000 4.000000000000 8.000000000000 16.000000000000 32.000000000000 64.000000000000 128.000000000000 256.000000000000 512.000000000000 1024.000000000000 ]; y=sol(x); yref=-682.000000000000 assert(abs(y-yref)<1e-6);

yref = -682

Error using assert The condition input argument must be a scalar logical. Error in Test2 (line 4) assert(abs(y-yref)<1e-6);

3   Fail
x=[ 1.000000000000 4.000000000000 9.000000000000 16.000000000000 25.000000000000 36.000000000000 49.000000000000 64.000000000000 81.000000000000 100.000000000000 ]; y=sol(x); yref=-55.000000000000 assert(abs(y-yref)<1e-6);

yref = -55

Error using assert The condition input argument must be a scalar logical. Error in Test3 (line 4) assert(abs(y-yref)<1e-6);

4   Fail
x=[ 1.000000000000 8.000000000000 27.000000000000 64.000000000000 125.000000000000 216.000000000000 343.000000000000 512.000000000000 729.000000000000 1000.000000000000 ]; y=sol(x); yref=-575.000000000000 assert(abs(y-yref)<1e-6);

yref = -575

Error using assert The condition input argument must be a scalar logical. Error in Test4 (line 4) assert(abs(y-yref)<1e-6);

5   Fail
x=[ 1.000000000000 0.500000000000 0.333333333333 0.250000000000 0.200000000000 0.166666666667 0.142857142857 0.125000000000 0.111111111111 0.100000000000 ]; y=sol(x); yref=0.645634920635 assert(abs(y-yref)<1e-6);

yref = 0.6456

Error using assert The condition input argument must be a scalar logical. Error in Test5 (line 4) assert(abs(y-yref)<1e-6);

6   Fail
x=[ 0.243132468125 -0.107772980466 0.155477890178 -0.328813312188 0.206046088020 -0.468167153623 -0.223077015039 -0.453828609369 -0.402868218764 0.323457828327 ]; y=sol(x); yref=1.013835439837 assert(abs(y-yref)<1e-6);

yref = 1.0138

Error using assert The condition input argument must be a scalar logical. Error in Test6 (line 4) assert(abs(y-yref)<1e-6);