Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 terms will be:
1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ...
By considering the terms in the Fibonacci sequence whose values do not exceed the input value, find the sum of the even-valued terms.
Solution Stats
Problem Comments
5 Comments
Solution Comments
Show comments
Loading...
Problem Recent Solvers2841
Suggested Problems
-
Find the numeric mean of the prime numbers in a matrix.
9139 Solvers
-
Find all elements less than 0 or greater than 10 and replace them with NaN
15784 Solvers
-
1713 Solvers
-
given 3 sides, find area of this triangle
820 Solvers
-
Project Euler: Problem 8, Find largest product in a large string of numbers
1309 Solvers
More from this Author96
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
I wanted to use : z = feval(symengine,'numlib::fibonacci',10)
to get the 10th element for example but CODY returns:
Could not check out Symbolic Math Toolbox license.
pas de chance!
You should add test cases where x or x+1 equals an even fibonacci number (either small or large).
Nice problem. I always have problem with big numbers.
I solved the problem until x = 4000000 but x = 97455000 it gives me an error of exceeding the memory(overflow) because the number is too large.
This was fun!