Cody

# Problem 1946. Fibonacci-Sum of Squares

Solution 2061596

Submitted on 18 Dec 2019 by Andrew Ramsay
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 = 5; S = 40; assert(isequal(FibSumSquares(n),S))

A = 0 0 0 0 0 B = 1 1 4 9 25

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

A = 0 0 0 0 0 0 0 0 B = 1 1 4 9 25 64 169 441

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

A = 0 0 0 0 0 0 0 0 0 0 0 B = 1 1 4 9 25 64 169 441 1156 3025 7921

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

A = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 B = 1 1 4 9 25 64 169 441 1156 3025 7921 20736 54289 142129 372100

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

A = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 B = Columns 1 through 15 1 1 4 9 25 64 169 441 1156 3025 7921 20736 54289 142129 372100 Columns 16 through 21 974169 2550409 6677056 17480761 45765225 119814916

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

A = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 B = 1.0e+10 * Columns 1 through 18 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0001 0.0003 0.0007 Columns 19 through 26 0.0017 0.0046 0.0120 0.0314 0.0821 0.2150 0.5629 1.4736