Cody

# Problem 1946. Fibonacci-Sum of Squares

Solution 1945266

Submitted on 22 Sep 2019 by Ngo Minh Ngoc
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))

S = 0 a = 1 S = 1 a = 1 S = 2 a = 4 S = 6 a = 9.0000 S = 15 a = 25.0000 S = 40

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

S = 0 a = 1 S = 1 a = 1 S = 2 a = 4 S = 6 a = 9.0000 S = 15 a = 25.0000 S = 40 a = 64.0000 S = 104 a = 169.0000 S = 273 a = 441.0000 S = 714

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

S = 0 a = 1 S = 1 a = 1 S = 2 a = 4 S = 6 a = 9.0000 S = 15 a = 25.0000 S = 40 a = 64.0000 S = 104 a = 169.0000 S = 273 a = 441.0000 S = 714 a = 1.1560e+03 S = 1870 a = 3.0250e+03 S = 4895 a = 7.9210e+03 S = 12816

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

S = 0 a = 1 S = 1 a = 1 S = 2 a = 4 S = 6 a = 9.0000 S = 15 a = 25.0000 S = 40 a = 64.0000 S = 104 a = 169.0000 S = 273 a = 441.0000 S = 714 a = 1.1560e+03 S = 1870 a = 3.0250e+03 S = 4895 a = 7.9210e+03 S = 12816 a = 2.0736e+04 S = 33552 a = 5.4289e+04 S = 87841 a = 1.4213e+05 S = 229970 a = 3.7210e+05 S = 602070

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

S = 0 a = 1 S = 1 a = 1 S = 2 a = 4 S = 6 a = 9.0000 S = 15 a = 25.0000 S = 40 a = 64.0000 S = 104 a = 169.0000 S = 273 a = 441.0000 S = 714 a = 1.1560e+03 S = 1870 a = 3.0250e+03 S = 4895 a = 7.9210e+03 S = 12816 a = 2.0736e+04 S = 33552 a = 5.4289e+04 S = 87841 a = 1.4213e+05 S = 229970 a = 3.7210e+05 S = 602070 a = 9.7417e+05 S = 1576239 a = 2.5504e+06 S = 4126648 a = 6.6771e+06 S = 10803704 a = 1.7481e+07 S = 28284465 a = 4.5765e+07 S = 74049690 a = 1.1981e+08 S = 193864606

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

S = 0 a = 1 S = 1 a = 1 S = 2 a = 4 S = 6 a = 9.0000 S = 15 a = 25.0000 S = 40 a = 64.0000 S = 104 a = 169.0000 S = 273 a = 441.0000 S = 714 a = 1.1560e+03 S = 1870 a = 3.0250e+03 S = 4895 a = 7.9210e+03 S = 12816 a = 2.0736e+04 S = 33552 a = 5.4289e+04 S = 87841 a = 1.4213e+05 S = 229970 a = 3.7210e+05 S = 602070 a = 9.7417e+05 S = 1576239 a = 2.5504e+06 S = 4126648 a = 6.6771e+06 S = 10803704 a = 1.7481e+07 S = 28284465 a = 4.5765e+07 S = 74049690 a = 1.1981e+08 S = 193864606 a = 3.1368e+08 S = 507544127 a = 8.2122e+08 S = 1.3288e+09 a = 2.1500e+09 S = 3.4788e+09 a = 5.6288e+09 S = 9.1075e+09 a = 1.4736e+10 S = 2.3844e+10

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!