Sum of Even Fibonacci Numbers - MATLAB Cody - MATLAB Central

Problem 60791. Sum of Even Fibonacci Numbers

Difficulty:Rate
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

53.33% Correct | 46.67% Incorrect
Last Solution submitted on Mar 07, 2025

Solution Comments

Show comments

Problem Recent Solvers8

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!
Go to top of page