Cody

# Problem 240. Project Euler: Problem 6, Natural numbers, squares and sums.

Solution 1908292

Submitted on 21 Aug 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 = 10; y_correct = 2640; assert(isequal(euler006(x),y_correct))

Error using ^ (line 51) Incorrect dimensions for raising a matrix to a power. Check that the matrix is square and the power is a scalar. To perform elementwise matrix powers, use '.^'. Error in euler006 (line 3) y = sum(z).^2 - sum(z^2); Error in Test1 (line 3) assert(isequal(euler006(x),y_correct))

2   Fail
x = 20; y_correct = 41230; assert(isequal(euler006(x),y_correct))

Error using ^ (line 51) Incorrect dimensions for raising a matrix to a power. Check that the matrix is square and the power is a scalar. To perform elementwise matrix powers, use '.^'. Error in euler006 (line 3) y = sum(z).^2 - sum(z^2); Error in Test2 (line 3) assert(isequal(euler006(x),y_correct))

3   Fail
x = 200; y_correct = 401323300; assert(isequal(euler006(x),y_correct))

Error using ^ (line 51) Incorrect dimensions for raising a matrix to a power. Check that the matrix is square and the power is a scalar. To perform elementwise matrix powers, use '.^'. Error in euler006 (line 3) y = sum(z).^2 - sum(z^2); Error in Test3 (line 3) assert(isequal(euler006(x),y_correct))