Cody

# Problem 1946. Fibonacci-Sum of Squares

Solution 2036750

Submitted on 27 Nov 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
n = 5; S = 40; assert(isequal(FibSumSquares(n),S))

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 FibSumSquares (line 2) S = [1 1; 1 0] ^ (1:n) Error in Test1 (line 3) assert(isequal(FibSumSquares(n),S))

2   Fail
n = 8; S = 714; assert(isequal(FibSumSquares(n),S))

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 FibSumSquares (line 2) S = [1 1; 1 0] ^ (1:n) Error in Test2 (line 3) assert(isequal(FibSumSquares(n),S))

3   Fail
n = 11; S = 12816; assert(isequal(FibSumSquares(n),S))

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 FibSumSquares (line 2) S = [1 1; 1 0] ^ (1:n) Error in Test3 (line 3) assert(isequal(FibSumSquares(n),S))

4   Fail
n = 15; S = 602070; assert(isequal(FibSumSquares(n),S))

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 FibSumSquares (line 2) S = [1 1; 1 0] ^ (1:n) Error in Test4 (line 3) assert(isequal(FibSumSquares(n),S))

5   Fail
n = 21; S = 193864606; assert(isequal(FibSumSquares(n),S))

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 FibSumSquares (line 2) S = [1 1; 1 0] ^ (1:n) Error in Test5 (line 3) assert(isequal(FibSumSquares(n),S))

6   Fail
n = 26; S = 23843770274; assert(isequal(FibSumSquares(n),S))

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 FibSumSquares (line 2) S = [1 1; 1 0] ^ (1:n) Error in Test6 (line 3) assert(isequal(FibSumSquares(n),S))