Given the Fibonacci sequence defined by the following recursive relation,

  • F(n) = F(n-1) + F(n-2)
  • where F(1) = 1 and F(1) = 1

determine the sum of squares for the first "n" terms.

For example, n=5 --> 1^2 + 1^2 + 2^2 + 3^2 + 5^2 = 40.

  • INPUT n=5
  • OUTPUT S=40

Solution Stats

3836 Solutions

1709 Solvers

Last Solution submitted on Feb 15, 2026

Last 200 Solutions

Problem Comments

Solution Comments

Show comments
Loading...

Problem Recent Solvers1709

Suggested Problems

Problem Tags

Community Treasure Hunt

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

Start Hunting!