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, ...
Find the sum of all the even-valued terms in the sequence which do not exceed four million.
1
1
2 -- 2
3 -- 2
5 -- 2
8 -- 10
13 -- 10
21 -- 10
34 -- 44
55 -- 44
89 -- 44
144 -- 188
233 -- 188
377 -- 188
610 -- 798
987 -- 798
1597 -- 798
2584 -- 3382
4181 -- 3382
6765 -- 3382
10946 -- 14328
17711 -- 14328
28657 -- 14328
46368 -- 60696
75025 -- 60696
121393 -- 60696
196418 -- 257114
317811 -- 257114
514229 -- 257114
832040 -- 1089154
1346269 -- 1089154
2178309 -- 1089154
3524578 -- 4613732