Problem 60791. Sum of Even Fibonacci Numbers
Description:
The Fibonacci sequence is defined as follows:F(1)=1,F(2)=1,F(n)=F(n−1)+F(n−2) 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
Solution Comments
Show comments
Problem Recent Solvers27
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!