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

85.71% Correct | 14.29% Incorrect
Last Solution submitted on Feb 20, 2025

Solution Comments

Show comments
MATLAB Without Borders: Connecting your projects with Python and other Open Source Tools.
On 27th February María Elena Gavilán Alfonso and I will be giving...
0
4

Problem Recent Solvers6

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