Cody

# Problem 1946. Fibonacci-Sum of Squares

Solution 2033481

Submitted on 24 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))

S = 1 S = 1 S = 2 S = 4 S = 1 S = 1 S = 2 S = 4 S = 8 S = 64

Assertion failed.

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

Out of memory. The likely cause is an infinite recursion within the program. Error in FibSumSquares (line 6) S = [S FibSumSquares(n-2)+FibSumSquares(n-2)]

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

S = 1 S = 1 S = 2 S = 4 S = 1 S = 1 S = 2 S = 4 S = 8 S = 64 S = 1 S = 1 S = 2 S = 4 S = 1 S = 1 S = 2 S = 4 S = 8 S = 64 S = 128 S = 16384 S = 1 S = 1 S = 2 S = 4 S = 1 S = 1 S = 2 S = 4 S = 8 S = 64 S = 1 S = 1 S = 2 S = 4 S = 1 S = 1 S = 2 S = 4 S = 8 S = 64 S = 128 S = 16384 S = 32768 S = 1.0737e+09 S = 1 S = 1 S = 2 S = 4 S = 1 S = 1 S = 2 S = 4 S = 8 S = 64 S = 1 S = 1 S = 2 S = 4 S = 1 S = 1 S = 2 S = 4 S = 8 S = 64 S = 128 S = 16384 S = 1 S = 1 S = 2 S = 4 S = 1 S = 1 S = 2 S = 4 S = 8 S = 64 S = 1 S = 1 S = 2 S = 4 S = 1 S = 1 S = 2 S = 4 S = 8 S = 64 S = 128 S = 16384 S = 32768 S = 1.0737e+09 S = 2.1475e+09 S = 4.6117e+18

Assertion failed.

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

S = 1 S = 1 S = 2 S = 4 S = 1 S = 1 S = 2 S = 4 S = 8 S = 64 S = 1 S = 1 S = 2 S = 4 S = 1 S = 1 S = 2 S = 4 S = 8 S = 64 S = 128 S = 16384 S = 1 S = 1 S = 2 S = 4 S = 1 S = 1 S = 2 S = 4 S = 8 S = 64 S = 1 S = 1 S = 2 S = 4 S = 1 S = 1 S = 2 S = 4 S = 8 S = 64 S = 128 S = 16384 S = 32768 S = 1.0737e+09 S = 1 S = 1 S = 2 S = 4 S = 1 S = 1 S = 2 S = 4 S = 8 S = 64 S = 1 S = 1 S = 2 S = 4 S = 1 S = 1 S = 2 S = 4 S = 8 S = 64 S = 128 S = 16384 S = 1 S = 1 S = 2 S = 4 S = 1 S = 1 S = 2 S = 4 S = 8 S = 64 S = 1 S = 1 S = 2 S = 4 S = 1 S = 1 S = 2 S = 4 S = 8 S = 64 S = 128 S = 16384 S = 32768 S = 1.0737e+09 S = 2.1475e+09 S = 4.6117e+18 S = 1 S = 1 S = 2 S = 4 S = 1 S = 1 S = 2 S = 4 S = 8 S = 64 S = 1 S = 1 S = 2 S = 4 S = 1 S = 1 S = 2 S = 4 S = 8 S = 64 S = 128 S = 16384 S = 1 S = 1 S = 2 S = 4 S = 1 S = 1 S = 2 S = 4 S = 8 S = 64 S = 1 S = 1 S = 2 S = 4 S = 1 S = 1 S = 2 S = 4 S = 8 S = 64 S = 128 S = 16384 S = 32768 S = 1.0737e+09 S = 1 S = 1 S = 2 S = 4 S = 1 S = 1 S = 2 S = 4 S = 8 S = 64 S = 1 S = 1 S = 2 S = 4 S = 1 S = 1 S = 2 S = 4 S = 8 S = 64 S = 128 S = 16384 S = 1 S = 1 S = 2 S = 4 S = 1 S = 1 S = 2 S = 4 S = 8 S = 64 S = 1 S = 1 S = 2 S = 4 S = 1 S = 1 S = 2 S = 4 S = 8 S = 64 S = 128 S = 16384 S = 32768 S = 1.0737e+09 S = 2.1475e+09 S = 4.6117e+18 S = 9.2234e+18 S = 8.5071e+37 S = 1 S = 1 S = 2 S = 4 S = 1 S = 1 S = 2 S = 4 S = 8 S = 64 S = 1 S = 1 S = 2 S = 4 S = 1 S = 1 S = 2 S = 4 S = 8 S = 64 S = 128 S = 16384 S = 1 S = 1 S = 2 S = 4 S = 1 S = 1 S = 2 S = 4 S = 8 S = 64 S = 1 S = 1 S = 2 S = 4 S = 1 S = 1 S = 2 S = 4 S = 8 S = 64 S = 128 S = 16384 S = 32768 S = 1.0737e+09 S = 1 S = 1 S = 2 S = 4 S = 1 S = 1 S = 2 S = 4 S = 8 S = 64 S = 1 S = 1 S = 2 S = 4 S = 1 S = 1 S = 2 S = 4 S = 8 S = 64 S = 128 S = 16384 S = 1 S = 1 S = 2 S = 4 S = 1 S = 1 S = 2 S = 4 S = 8 S = 64 S = 1 S = 1 S = 2 S = 4 S = 1 S = 1 S = 2 S = 4 S = 8 S = 64 S = 128 S = 16384 S = 32768 S = 1.0737e+09 S = 2.1475e+09 S = 4.6117e+18 S = 1 S = 1 S = 2 S = 4 S = 1 S = 1 S = 2 S = 4 S = 8 S = 64 S = 1 S = 1 S = 2 S = 4 S = 1 S = 1 S = 2 S = 4 S = 8 S = 64 S = 128 S = 16384 S = 1 S = 1 S = 2 S = 4 S = 1 S = 1 S = 2 S = 4 S = 8 S = 64 S = 1 S = 1 S = 2 S = 4 S = 1 S = 1 S = 2 S = 4 S = 8 S = 64 S = 128 S = 16384 S = 32768 S = 1.0737e+09 S = 1 S = 1 S = 2 S = 4 S = 1 S = 1 S = 2 S = 4 S = 8 S = 64 S = 1 S = 1 S = 2 S = 4 S = 1 S = 1 S = 2 S = 4 S = 8 S = 64 S = 128 S = 16384 S = 1 S = 1 S = 2 S = 4 S = 1 S = 1 S = 2 S = 4 S = 8 S = 64 S = 1 S = 1 S = 2 S = 4 S = 1 S = 1 S = 2 S = 4 S = 8 S = 64 S = 128 S = 16384 S = 32768 S = 1.0737e+09 S = 2.1475e+09 S = 4.6117e+18 S = 9.2234e+18 S = 8.5071e+37 S = 1.7014e+38 S = 2.8948e+76

Assertion failed.

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

S = 1 S = 1 S = 2 S = 4 S = 1 S = 1 S = 2 S = 4 S = 8 S = 64 S = 1 S = 1 S = 2 S = 4 S = 1 S = 1 S = 2 S = 4 S = 8 S = 64 S = 128 S = 16384 S = 1 S = 1 S = 2 S = 4 S = 1 S = 1 S = 2 S = 4 S = 8 S = 64 S = 1 S = 1 S = 2 S = 4 S = 1 S = 1 S = 2 S = 4 S = 8 S = 64 S = 128 S = 16384 S = 32768 S = 1.0737e+09 S = 1 S = 1 S = 2 S = 4 S = 1 S = 1 S = 2 S = 4 S = 8 S = 64 S = 1 S = 1 S = 2 S = 4 S = 1 S = 1 S = 2 S = 4 S = 8 S = 64 S = 128 S = 16384 S = 1 S = 1 S = 2 S = 4 S = 1 S = 1 S = 2 S = 4 S = 8 S = 64 S = 1 S = 1 S = 2 S = 4 S = 1 S = 1 S = 2 S = 4 S = 8 S = 64 S = 128 S = 16384 S = 32768 S = 1.0737e+09 S = 2.1475e+09 S = 4.6117e+18 S = 1 S = 1 S = 2 S = 4 S = 1 S = 1 S = 2 S = 4 S = 8 S = 64 S = 1 S = 1 S = 2 S = 4 S = 1 S = 1 S = 2 S = 4 S = 8 S = 64 S = 128 S = 16384 S = 1 S = 1 S = 2 S = 4 S = 1 S = 1 S = 2 S = 4 S = 8 S = 64 S = 1 S = 1 S = 2 S = 4 S = 1 S = 1 S = 2 S = 4 S = 8 S = 64 S = 128 S = 16384 S = 32768 S = 1.0737e+09 S = 1 S = 1 S = 2 S = 4 S = 1 S = 1 S = 2 S = 4 S = 8 S = 64 S = 1 S = 1 S = 2 S = 4 S = 1 S = 1 S = 2 S = 4 S = 8 S = 64 S = 128 S = 16384 S = 1 S = 1 S = 2 S = 4 S = 1 S = 1 S = 2 S = 4 S = 8 S = 64 S = 1 S = 1 S = 2 S = 4 S = 1 S = 1 S = 2 S = 4 S = 8 S = 64 S = 128 S = 16384 S = 32768 S = 1.0737e+09 S = 2.1475e+09 S = 4.6117e+18 S = 9.2234e+18 S = 8.5071e+37 S = 1 S = 1 S = 2 S = 4 S = 1 S = 1 S = 2 S = 4 S = 8 S = 64 S = 1 S = 1 S = 2 S = 4 S = 1 S = 1 S = 2 S = 4 S = 8 S = 64 S = 128 S = 16384 S = 1 S = 1 S = 2 S = 4 S = 1 S = 1 S = 2 S = 4 S = 8 S = 64 S = 1 S = 1 S = 2 S = 4 S = 1 S = 1 S = 2 S = 4 S = 8 S = 64 S = 128 S = 16384 S = 32768 S = 1.0737e+09 S = 1 S = 1 S = 2 S = 4 S = 1 S = 1 S = 2 S = 4 S = 8 S = 64 S = 1 S = 1 S = 2 S = 4 S = 1 S = 1 S = 2 S = 4 S = 8 S = 64 S = 128 S = 16384 S = 1 S = 1 S = 2 S = 4 S = 1 S = 1 S = 2 S = 4 S = 8 S = 64 S = 1 S = 1 S = 2 S = 4 S = 1 S = 1 S = 2 S = 4 S = 8 S = 64 S = 128 S = 16384 S = 32768 S = 1.0737e+09 S = 2.1475e+09 S = 4.6117e+18 S = 1 S = 1 S = 2 S = 4 S = 1 S = 1 S = 2 S = 4 S = 8 S = 64 S = 1 S = 1 S = 2 S = 4 S = 1 S = 1 S = 2 S = 4 S = 8 S = 64 S = 128 S = 16384 S = 1 S = 1 S = 2 S = 4 S = 1 S = 1 S = 2 S = 4 S = 8 S = 64 S = 1 S = 1 S = 2 S = 4 S = 1 S = 1 S = 2 S = 4 S = 8 S = 64 S = 128 S = 16384 S = 32768 S = 1.0737e+09 S = 1 S = 1 S = 2 S = 4 S = 1 S = 1 S = 2 S = 4 S = 8 S = 64 S = 1 S = 1 S = 2 S = 4 S = 1 S = 1 S = 2 S = 4 S = 8 S = 64 S = 128 S = 16384 S = 1 S = 1 S = 2 S = 4 S = 1 S = 1 S = 2 S = 4 S = 8 S = 64 S = 1 S = 1 S = 2 S = 4 S = 1 S = 1 S = 2 S = 4 S = 8 S = 64 S = 128 S = 16384 S = 32768 S = 1.0737e+09 S = 2.1475e+09 S = 4.6117e+18 S = 9.2234e+18 S = 8.5071e+37 S = 1.7014e+38 S = 2.8948e+76 S = 1 S = 1 S = 2 S = 4 S = 1 S = 1 S = 2 S = 4 S = 8 S = 64 S = 1 S = 1 S = 2 S = 4 S = 1 S = 1 S = 2 S = 4 S = 8 S = 64 S = 128 S = 16384 S = 1 S = 1 S = 2 S = 4 S = 1 S = 1 S = 2 S = 4 S = 8 S = 64 S = 1 S = 1 S = 2 S = 4 S = 1 S = 1 S = 2 S = 4 S = 8 S = 64 S = 128 S = 16384 S = 32768 S = 1.0737e+09 S = 1 S = 1 S = 2 S = 4 S = 1 S = 1 S = 2 S = 4 S = 8 S = 64 S = 1 S = 1 S = 2 S = 4 S = 1 S = 1 S = 2 S = 4 S = 8 S = 64 S = 128 S = 16384 S = 1 S = 1 S = 2 S = 4 S = 1 S = 1 S = 2 S = 4 S = 8 S = 64 S = 1 S = 1 S = 2 S = 4 S = 1 S = 1 S = 2 S = 4 S = 8 S = 64 S = 128 S = 16384 S = 32768 S = 1.0737e+09 S = 2.1475e+09 S = 4.6117e+18 S = 1 S = 1 S = 2 S = 4 S = 1 S = 1 S = 2 S = 4 S = 8 S = 64 S = 1 S = 1 S = 2 S = 4 S = 1 S = 1 S = 2 S = 4 S = 8 S = 64 S = 128 S = 16384 S = 1 S = 1 S = 2 S = 4 S = 1 S = 1 S = 2 S = 4 S = 8 S = 64 S = 1 S = 1 S = 2 S = 4 S = 1 S = 1 S = 2 S = 4 S = 8 S = 64 S = 128 S = 16384 S = 32768 S = 1.0737e+09 S = 1 S = 1 S = 2 S = 4 S = 1 S = 1 S = 2 S = 4 S = 8 S = 64 S = 1 S = 1 S = 2 S = 4 S = 1 S = 1 S = 2 S = 4 S = 8 S = 64 S = 128 S = 16384 S = 1 S = 1 S = 2 S = 4 S = 1 S = 1 S = 2 S = 4 S = 8 S = 64 S = 1 S = 1 S = 2 S = 4 S = 1 S = 1 S = 2 S = 4 S = 8 S = 64 S = 128 S = 16384 S = 32768 S = 1.0737e+09 S = 2.1475e+09 S = 4.6117e+18 S = 9.2234e+18 S = 8.5071e+37 S = 1 S = 1 S = 2 S = 4 S = 1 S = 1 S = 2 S = 4 S = 8 S = 64 S = 1 S = 1 S = 2 S = 4 S = 1 S = 1 S = 2 S = 4 S = 8 S = 64 S = 128 S = 16384 S = 1 S = 1 S = 2 S = 4 S = 1 S = 1 S = 2 S = 4 S = 8 S = 64 S = 1 S = 1 S = 2 S = 4 S = 1 S = 1 S = 2 S = 4 S = 8 S = 64 S = 128 S = 16384 S = 32768 S = 1.0737e+09 S = 1 S = 1 S = 2 S = 4 S = 1 S = 1 S = 2 S = 4 S = 8 S = 64 S = 1 S = 1 S = 2 S = 4 S = 1 S = 1 S = 2 S = 4 S = 8 S = 64 S = 128 S = 16384 S = 1 S = 1 S = 2 S = 4 S = 1 S = 1 S = 2 S = 4 S = 8 S = 64 S = 1 S = 1 S = 2 S = 4 S = 1 S = 1 S = 2 S = 4 S = 8 S = 64 S = 128 S = 16384 S = 32768 S = 1.0737e+09 S = 2.1475e+09 S = 4.6117e+18 S = 1 S = 1 S = 2 S = 4 S = 1 S = 1 S = 2 S = 4 S = 8 S = 64 S = 1 S = 1 S = ...

Assertion failed.

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

Out of memory. The likely cause is an infinite recursion within the program. Error in FibSumSquares (line 6) S = [S FibSumSquares(n-2)+FibSumSquares(n-2)]