Today, I found the Euler Project. Problem #2 is
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 four million, find the sum of the even-valued terms.
I have two solutions:
For[i = 1, i < 100, i++, If[Fibonacci[i] > 4000000, Break[]]];
Plus @@ Select[Fibonacci /@ Range[i - 1], Mod[#, 2] == 0 &]
4613732
Plus @@ Select[
Fibonacci /@ Select[Range@100, Fibonacci@# < 4000000 &],
Mod[#1, 2] == 0 &]
4613732
However, I feel my solutions are not good and efficient. So my question is: can you show me more concise and efficient methods?
Also, how cam I test whether a number is a Fibonacci number?