Problem 60791. Sum of Even Fibonacci Numbers

Description:
The Fibonacci sequence is defined as follows:F(1)=1,F(2)=1,F(n)=F(n1)+F(n2) for n>2
Write a function that computes the sum of all even Fibonacci numbers that do not exceed a given number NNN.
Example:
For N=10, the Fibonacci sequence up to 10 is:
1,1,2,3,5,8
The even numbers are 2 and 8, and their sum is 10.

Solution Stats

100.0% Correct | 0.0% Incorrect
Last Solution submitted on Feb 13, 2025

Solution Comments

Show comments

Problem Recent Solvers5

Suggested Problems

More from this Author20

Problem Tags

Community Treasure Hunt

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

Start Hunting!