Fibonacci-Sum of Squares - MATLAB Cody - MATLAB Central

Problem 1946. Fibonacci-Sum of Squares

Difficulty:Rate

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

47.16% Correct | 52.84% Incorrect
Last Solution submitted on May 06, 2025

Problem Comments

Solution Comments

Show comments
LLMs with MATLAB updated to support the latest OpenAI Models
Large Languge model with MATLAB, a free add-on that lets you access...
2
3

Problem Recent Solvers1502

Suggested Problems

Problem Tags

Community Treasure Hunt

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

Start Hunting!
Go to top of page