Cody

# Problem 232. Project Euler: Problem 2, Sum of even Fibonacci

Solution 570963

Submitted on 31 Jan 2015 by Debopam
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

### Test Suite

Test Status Code Input and Output
1   Pass
%% x =4000000 y_correct = 4613732; assert(isequal(euler002(x),y_correct))

x = 4000000 c = 1 a = 1 b = 1 c = 2 a = 1 b = 2 y = 2 c = 3 a = 2 b = 3 c = 5 a = 3 b = 5 c = 8 a = 5 b = 8 y = 10 c = 13 a = 8 b = 13 c = 21 a = 13 b = 21 c = 34 a = 21 b = 34 y = 44 c = 55 a = 34 b = 55 c = 89 a = 55 b = 89 c = 144 a = 89 b = 144 y = 188 c = 233 a = 144 b = 233 c = 377 a = 233 b = 377 c = 610 a = 377 b = 610 y = 798 c = 987 a = 610 b = 987 c = 1597 a = 987 b = 1597 c = 2584 a = 1597 b = 2584 y = 3382 c = 4181 a = 2584 b = 4181 c = 6765 a = 4181 b = 6765 c = 10946 a = 6765 b = 10946 y = 14328 c = 17711 a = 10946 b = 17711 c = 28657 a = 17711 b = 28657 c = 46368 a = 28657 b = 46368 y = 60696 c = 75025 a = 46368 b = 75025 c = 121393 a = 75025 b = 121393 c = 196418 a = 121393 b = 196418 y = 257114 c = 317811 a = 196418 b = 317811 c = 514229 a = 317811 b = 514229 c = 832040 a = 514229 b = 832040 y = 1089154 c = 1346269 a = 832040 b = 1346269 c = 2178309 a = 1346269 b = 2178309 c = 3524578 a = 2178309 b = 3524578 y = 4613732 c = 5702887 a = 3524578 b = 5702887

2   Pass
%% x =97455000 y_correct = 82790070; assert(isequal(euler002(x),y_correct))

x = 97455000 c = 1 a = 1 b = 1 c = 2 a = 1 b = 2 y = 2 c = 3 a = 2 b = 3 c = 5 a = 3 b = 5 c = 8 a = 5 b = 8 y = 10 c = 13 a = 8 b = 13 c = 21 a = 13 b = 21 c = 34 a = 21 b = 34 y = 44 c = 55 a = 34 b = 55 c = 89 a = 55 b = 89 c = 144 a = 89 b = 144 y = 188 c = 233 a = 144 b = 233 c = 377 a = 233 b = 377 c = 610 a = 377 b = 610 y = 798 c = 987 a = 610 b = 987 c = 1597 a = 987 b = 1597 c = 2584 a = 1597 b = 2584 y = 3382 c = 4181 a = 2584 b = 4181 c = 6765 a = 4181 b = 6765 c = 10946 a = 6765 b = 10946 y = 14328 c = 17711 a = 10946 b = 17711 c = 28657 a = 17711 b = 28657 c = 46368 a = 28657 b = 46368 y = 60696 c = 75025 a = 46368 b = 75025 c = 121393 a = 75025 b = 121393 c = 196418 a = 121393 b = 196418 y = 257114 c = 317811 a = 196418 b = 317811 c = 514229 a = 317811 b = 514229 c = 832040 a = 514229 b = 832040 y = 1089154 c = 1346269 a = 832040 b = 1346269 c = 2178309 a = 1346269 b = 2178309 c = 3524578 a = 2178309 b = 3524578 y = 4613732 c = 5702887 a = 3524578 b = 5702887 c = 9227465 a = 5702887 b = 9227465 c = 14930352 a = 9227465 b = 14930352 y = 19544084 c = 24157817 a = 14930352 b = 24157817 c = 39088169 a = 24157817 b = 39088169 c = 63245986 a = 39088169 b = 63245986 y = 82790070 c = 102334155 a = 63245986 b = 102334155

3   Pass
%% x =597455000 y_correct = 350704366; assert(isequal(euler002(x),y_correct))

x = 597455000 c = 1 a = 1 b = 1 c = 2 a = 1 b = 2 y = 2 c = 3 a = 2 b = 3 c = 5 a = 3 b = 5 c = 8 a = 5 b = 8 y = 10 c = 13 a = 8 b = 13 c = 21 a = 13 b = 21 c = 34 a = 21 b = 34 y = 44 c = 55 a = 34 b = 55 c = 89 a = 55 b = 89 c = 144 a = 89 b = 144 y = 188 c = 233 a = 144 b = 233 c = 377 a = 233 b = 377 c = 610 a = 377 b = 610 y = 798 c = 987 a = 610 b = 987 c = 1597 a = 987 b = 1597 c = 2584 a = 1597 b = 2584 y = 3382 c = 4181 a = 2584 b = 4181 c = 6765 a = 4181 b = 6765 c = 10946 a = 6765 b = 10946 y = 14328 c = 17711 a = 10946 b = 17711 c = 28657 a = 17711 b = 28657 c = 46368 a = 28657 b = 46368 y = 60696 c = 75025 a = 46368 b = 75025 c = 121393 a = 75025 b = 121393 c = 196418 a = 121393 b = 196418 y = 257114 c = 317811 a = 196418 b = 317811 c = 514229 a = 317811 b = 514229 c = 832040 a = 514229 b = 832040 y = 1089154 c = 1346269 a = 832040 b = 1346269 c = 2178309 a = 1346269 b = 2178309 c = 3524578 a = 2178309 b = 3524578 y = 4613732 c = 5702887 a = 3524578 b = 5702887 c = 9227465 a = 5702887 b = 9227465 c = 14930352 a = 9227465 b = 14930352 y = 19544084 c = 24157817 a = 14930352 b = 24157817 c = 39088169 a = 24157817 b = 39088169 c = 63245986 a = 39088169 b = 63245986 y = 82790070 c = 102334155 a = 63245986 b = 102334155 c = 165580141 a = 102334155 b = 165580141 c = 267914296 a = 165580141 b = 267914296 y = 350704366 c = 433494437 a = 267914296 b = 433494437 c = 701408733 a = 433494437 b = 701408733

4   Pass
%% x =666576 y_correct = 257114; assert(isequal(euler002(x),y_correct))

x = 666576 c = 1 a = 1 b = 1 c = 2 a = 1 b = 2 y = 2 c = 3 a = 2 b = 3 c = 5 a = 3 b = 5 c = 8 a = 5 b = 8 y = 10 c = 13 a = 8 b = 13 c = 21 a = 13 b = 21 c = 34 a = 21 b = 34 y = 44 c = 55 a = 34 b = 55 c = 89 a = 55 b = 89 c = 144 a = 89 b = 144 y = 188 c = 233 a = 144 b = 233 c = 377 a = 233 b = 377 c = 610 a = 377 b = 610 y = 798 c = 987 a = 610 b = 987 c = 1597 a = 987 b = 1597 c = 2584 a = 1597 b = 2584 y = 3382 c = 4181 a = 2584 b = 4181 c = 6765 a = 4181 b = 6765 c = 10946 a = 6765 b = 10946 y = 14328 c = 17711 a = 10946 b = 17711 c = 28657 a = 17711 b = 28657 c = 46368 a = 28657 b = 46368 y = 60696 c = 75025 a = 46368 b = 75025 c = 121393 a = 75025 b = 121393 c = 196418 a = 121393 b = 196418 y = 257114 c = 317811 a = 196418 b = 317811 c = 514229 a = 317811 b = 514229 c = 832040 a = 514229 b = 832040 y = 1089154 y = 257114