Cody

Solution 2138960

Submitted on 24 Feb 2020 by Cullen Walsh
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 z = 1 2 3 d = 4 n = 3 z = 1 2 3 5 d = 5 n = 5 z = 1 2 3 5 8 d = 6 n = 8 z = 1 2 3 5 8 13 d = 7 n = 13 z = 1 2 3 5 8 13 21 d = 8 n = 21 z = 1 2 3 5 8 13 21 34 d = 9 n = 34 z = 1 2 3 5 8 13 21 34 55 d = 10 n = 55 z = 1 2 3 5 8 13 21 34 55 89 d = 11 n = 89 z = 1 2 3 5 8 13 21 34 55 89 144 d = 12 n = 144 z = 1 2 3 5 8 13 21 34 55 89 144 233 d = 13 n = 233 z = 1 2 3 5 8 13 21 34 55 89 144 233 377 d = 14 n = 377 z = 1 2 3 5 8 13 21 34 55 89 144 233 377 610 d = 15 n = 610 z = 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 d = 16 n = 987 z = Columns 1 through 15 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 Column 16 1597 d = 17 n = 1597 z = Columns 1 through 15 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 Columns 16 through 17 1597 2584 d = 18 n = 2584 z = Columns 1 through 15 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 Columns 16 through 18 1597 2584 4181 d = 19 n = 4181 z = Columns 1 through 15 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 Columns 16 through 19 1597 2584 4181 6765 d = 20 n = 6765 z = Columns 1 through 15 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 Columns 16 through 20 1597 2584 4181 6765 10946 d = 21 n = 10946 z = Columns 1 through 15 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 Columns 16 through 21 1597 2584 4181 6765 10946 17711 d = 22 n = 17711 z = Columns 1 through 15 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 Columns 16 through 22 1597 2584 4181 6765 10946 17711 28657 d = 23 n = 28657 z = Columns 1 through 15 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 Columns 16 through 23 1597 2584 4181 6765 10946 17711 28657 46368 d = 24 n = 46368 z = Columns 1 through 15 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 Columns 16 through 24 1597 2584 4181 6765 10946 17711 28657 46368 75025 d = 25 n = 75025 z = Columns 1 through 15 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 Columns 16 through 25 1597 2584 4181 6765 10946 17711 28657 46368 75025 121393 d = 26 n = 121393 z = Columns 1 through 15 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 Columns 16 through 26 1597 2584 4181 6765 10946 17711 28657 46368 75025 121393 196418 d = 27 n = 196418 z = Columns 1 through 15 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 Columns 16 through 27 1597 2584 4181 6765 10946 17711 28657 46368 75025 121393 196418 317811 d = 28 n = 317811 z = Columns 1 through 15 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 Columns 16 through 28 1597 2584 4181 6765 10946 17711 28657 46368 75025 121393 196418 317811 514229 d = 29 n = 514229 z = Columns 1 through 15 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 Columns 16 through 29 1597 2584 4181 6765 10946 17711 28657 46368 75025 121393 196418 317811 514229 832040 d = 30 n = 832040 z = Columns 1 through 15 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 Columns 16 through 30 1597 2584 4181 6765 10946 17711 28657 46368 75025 121393 196418 317811 514229 832040 1346269 d = 31 n = 1346269 z = Columns 1 through 15 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 Columns 16 through 30 1597 2584 4181 6765 10946 17711 28657 46368 75025 121393 196418 317811 514229 832040 1346269 Column 31 2178309 d = 32 n = 2178309 z = Columns 1 through 15 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 Columns 16 through 30 1597 2584 4181 6765 10946 17711 28657 46368 75025 121393 196418 317811 514229 832040 1346269 Columns 31 through 32 2178309 3524578 d = 33 n = 3524578 z = Columns 1 through 15 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 Columns 16 through 30 1597 2584 4181 6765 10946 17711 28657 46368 75025 121393 196418 317811 514229 832040 1346269 Columns 31 through 33 2178309 3524578 5702887 d = 34 n = 5702887 z = Columns 1 through 15 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 Columns 16 through 30 1597 2584 4181 6765 10946 17711 28657 46368 75025 121393 196418 317811 514229 832040 1346269 Columns 31 through 32 2178309 3524578 s = 0 s = 2 s = 10 s = 44 s = 188 s = 798 s = 3382 s = 14328 s = 60696 s = 257114 s = 1089154 s = 4613732

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

x = 97455000 z = 1 2 3 d = 4 n = 3 z = 1 2 3 5 d = 5 n = 5 z = 1 2 3 5 8 d = 6 n = 8 z = 1 2 3 5 8 13 d = 7 n = 13 z = 1 2 3 5 8 13 21 d = 8 n = 21 z = 1 2 3 5 8 13 21 34 d = 9 n = 34 z = 1 2 3 5 8 13 21 34 55 d = 10 n = 55 z = 1 2 3 5 8 13 21 34 55 89 d = 11 n = 89 z = 1 2 3 5 8 13 21 34 55 89 144 d = 12 n = 144 z = 1 2 3 5 8 13 21 34 55 89 144 233 d = 13 n = 233 z = 1 2 3 5 8 13 21 34 55 89 144 233 377 d = 14 n = 377 z = 1 2 3 5 8 13 21 34 55 89 144 233 377 610 d = 15 n = 610 z = 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 d = 16 n = 987 z = Columns 1 through 15 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 Column 16 1597 d = 17 n = 1597 z = Columns 1 through 15 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 Columns 16 through 17 1597 2584 d = 18 n = 2584 z = Columns 1 through 15 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 Columns 16 through 18 1597 2584 4181 d = 19 n = 4181 z = Columns 1 through 15 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 Columns 16 through 19 1597 2584 4181 6765 d = 20 n = 6765 z = Columns 1 through 15 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 Columns 16 through 20 1597 2584 4181 6765 10946 d = 21 n = 10946 z = Columns 1 through 15 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 Columns 16 through 21 1597 2584 4181 6765 10946 17711 d = 22 n = 17711 z = Columns 1 through 15 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 Columns 16 through 22 1597 2584 4181 6765 10946 17711 28657 d = 23 n = 28657 z = Columns 1 through 15 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 Columns 16 through 23 1597 2584 4181 6765 10946 17711 28657 46368 d = 24 n = 46368 z = Columns 1 through 15 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 Columns 16 through 24 1597 2584 4181 6765 10946 17711 28657 46368 75025 d = 25 n = 75025 z = Columns 1 through 15 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 Columns 16 through 25 1597 2584 4181 6765 10946 17711 28657 46368 75025 121393 d = 26 n = 121393 z = Columns 1 through 15 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 Columns 16 through 26 1597 2584 4181 6765 10946 17711 28657 46368 75025 121393 196418 d = 27 n = 196418 z = Columns 1 through 15 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 Columns 16 through 27 1597 2584 4181 6765 10946 17711 28657 46368 75025 121393 196418 317811 d = 28 n = 317811 z = Columns 1 through 15 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 Columns 16 through 28 1597 2584 4181 6765 10946 17711 28657 46368 75025 121393 196418 317811 514229 d = 29 n = 514229 z = Columns 1 through 15 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 Columns 16 through 29 1597 2584 4181 6765 10946 17711 28657 46368 75025 121393 196418 317811 514229 832040 d = 30 n = 832040 z = Columns 1 through 15 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 Columns 16 through 30 1597 2584 4181 6765 10946 17711 28657 46368 75025 121393 196418 317811 514229 832040 1346269 d = 31 n = 1346269 z = Columns 1 through 15 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 Columns 16 through 30 1597 2584 4181 6765 10946 17711 28657 46368 75025 121393 196418 317811 514229 832040 1346269 Column 31 2178309 d = 32 n = 2178309 z = Columns 1 through 15 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 Columns 16 through 30 1597 2584 4181 6765 10946 17711 28657 46368 75025 121393 196418 317811 514229 832040 1346269 Columns 31 through 32 2178309 3524578 d = 33 n = 3524578 z = Columns 1 through 15 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 Columns 16 through 30 1597 2584 4181 6765 10946 17711 28657 46368 75025 121393 196418 317811 514229 832040 1346269 Columns 31 through 33 2178309 3524578 5702887 d = 34 n = 5702887 z = Columns 1 through 15 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 Columns 16 through 30 1597 2584 4181 6765 10946 17711 28657 46368 75025 121393 196418 317811 514229 832040 1346269 Columns 31 through 34 2178309 3524578 5702887 9227465 d = 35 n = 9227465 z = Columns 1 through 15 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 Columns 16 through 30 1597 2584 4181 6765 10946 17711 28657 46368 75025 121393 196418 317811 514229 832040 1346269 Columns 31 through 35 2178309 3524578 5702887 9227465 14930352 d = 36 n = 14930352 z = Columns 1 through 15 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 Columns 16 through 30 1597 2584 4181 6765 10946 17711 28657 46368 75025 121393 196418 317811 514229 832040 1346269 Columns 31 through 36 2178309 3524578 5702887 9227465 14930352 24157817 d = 37 n = 24157817 z = Columns 1 through 15 1 2 3 5 8 13 21 34 55 89 144 ...

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

x = 597455000 z = 1 2 3 d = 4 n = 3 z = 1 2 3 5 d = 5 n = 5 z = 1 2 3 5 8 d = 6 n = 8 z = 1 2 3 5 8 13 d = 7 n = 13 z = 1 2 3 5 8 13 21 d = 8 n = 21 z = 1 2 3 5 8 13 21 34 d = 9 n = 34 z = 1 2 3 5 8 13 21 34 55 d = 10 n = 55 z = 1 2 3 5 8 13 21 34 55 89 d = 11 n = 89 z = 1 2 3 5 8 13 21 34 55 89 144 d = 12 n = 144 z = 1 2 3 5 8 13 21 34 55 89 144 233 d = 13 n = 233 z = 1 2 3 5 8 13 21 34 55 89 144 233 377 d = 14 n = 377 z = 1 2 3 5 8 13 21 34 55 89 144 233 377 610 d = 15 n = 610 z = 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 d = 16 n = 987 z = Columns 1 through 15 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 Column 16 1597 d = 17 n = 1597 z = Columns 1 through 15 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 Columns 16 through 17 1597 2584 d = 18 n = 2584 z = Columns 1 through 15 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 Columns 16 through 18 1597 2584 4181 d = 19 n = 4181 z = Columns 1 through 15 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 Columns 16 through 19 1597 2584 4181 6765 d = 20 n = 6765 z = Columns 1 through 15 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 Columns 16 through 20 1597 2584 4181 6765 10946 d = 21 n = 10946 z = Columns 1 through 15 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 Columns 16 through 21 1597 2584 4181 6765 10946 17711 d = 22 n = 17711 z = Columns 1 through 15 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 Columns 16 through 22 1597 2584 4181 6765 10946 17711 28657 d = 23 n = 28657 z = Columns 1 through 15 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 Columns 16 through 23 1597 2584 4181 6765 10946 17711 28657 46368 d = 24 n = 46368 z = Columns 1 through 15 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 Columns 16 through 24 1597 2584 4181 6765 10946 17711 28657 46368 75025 d = 25 n = 75025 z = Columns 1 through 15 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 Columns 16 through 25 1597 2584 4181 6765 10946 17711 28657 46368 75025 121393 d = 26 n = 121393 z = Columns 1 through 15 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 Columns 16 through 26 1597 2584 4181 6765 10946 17711 28657 46368 75025 121393 196418 d = 27 n = 196418 z = Columns 1 through 15 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 Columns 16 through 27 1597 2584 4181 6765 10946 17711 28657 46368 75025 121393 196418 317811 d = 28 n = 317811 z = Columns 1 through 15 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 Columns 16 through 28 1597 2584 4181 6765 10946 17711 28657 46368 75025 121393 196418 317811 514229 d = 29 n = 514229 z = Columns 1 through 15 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 Columns 16 through 29 1597 2584 4181 6765 10946 17711 28657 46368 75025 121393 196418 317811 514229 832040 d = 30 n = 832040 z = Columns 1 through 15 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 Columns 16 through 30 1597 2584 4181 6765 10946 17711 28657 46368 75025 121393 196418 317811 514229 832040 1346269 d = 31 n = 1346269 z = Columns 1 through 15 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 Columns 16 through 30 1597 2584 4181 6765 10946 17711 28657 46368 75025 121393 196418 317811 514229 832040 1346269 Column 31 2178309 d = 32 n = 2178309 z = Columns 1 through 15 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 Columns 16 through 30 1597 2584 4181 6765 10946 17711 28657 46368 75025 121393 196418 317811 514229 832040 1346269 Columns 31 through 32 2178309 3524578 d = 33 n = 3524578 z = Columns 1 through 15 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 Columns 16 through 30 1597 2584 4181 6765 10946 17711 28657 46368 75025 121393 196418 317811 514229 832040 1346269 Columns 31 through 33 2178309 3524578 5702887 d = 34 n = 5702887 z = Columns 1 through 15 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 Columns 16 through 30 1597 2584 4181 6765 10946 17711 28657 46368 75025 121393 196418 317811 514229 832040 1346269 Columns 31 through 34 2178309 3524578 5702887 9227465 d = 35 n = 9227465 z = Columns 1 through 15 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 Columns 16 through 30 1597 2584 4181 6765 10946 17711 28657 46368 75025 121393 196418 317811 514229 832040 1346269 Columns 31 through 35 2178309 3524578 5702887 9227465 14930352 d = 36 n = 14930352 z = Columns 1 through 15 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 Columns 16 through 30 1597 2584 4181 6765 10946 17711 28657 46368 75025 121393 196418 317811 514229 832040 1346269 Columns 31 through 36 2178309 3524578 5702887 9227465 14930352 24157817 d = 37 n = 24157817 z = Columns 1 through 15 1 2 3 5 8 13 21 34 55 89 144 ...

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

x = 666576 z = 1 2 3 d = 4 n = 3 z = 1 2 3 5 d = 5 n = 5 z = 1 2 3 5 8 d = 6 n = 8 z = 1 2 3 5 8 13 d = 7 n = 13 z = 1 2 3 5 8 13 21 d = 8 n = 21 z = 1 2 3 5 8 13 21 34 d = 9 n = 34 z = 1 2 3 5 8 13 21 34 55 d = 10 n = 55 z = 1 2 3 5 8 13 21 34 55 89 d = 11 n = 89 z = 1 2 3 5 8 13 21 34 55 89 144 d = 12 n = 144 z = 1 2 3 5 8 13 21 34 55 89 144 233 d = 13 n = 233 z = 1 2 3 5 8 13 21 34 55 89 144 233 377 d = 14 n = 377 z = 1 2 3 5 8 13 21 34 55 89 144 233 377 610 d = 15 n = 610 z = 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 d = 16 n = 987 z = Columns 1 through 15 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 Column 16 1597 d = 17 n = 1597 z = Columns 1 through 15 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 Columns 16 through 17 1597 2584 d = 18 n = 2584 z = Columns 1 through 15 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 Columns 16 through 18 1597 2584 4181 d = 19 n = 4181 z = Columns 1 through 15 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 Columns 16 through 19 1597 2584 4181 6765 d = 20 n = 6765 z = Columns 1 through 15 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 Columns 16 through 20 1597 2584 4181 6765 10946 d = 21 n = 10946 z = Columns 1 through 15 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 Columns 16 through 21 1597 2584 4181 6765 10946 17711 d = 22 n = 17711 z = Columns 1 through 15 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 Columns 16 through 22 1597 2584 4181 6765 10946 17711 28657 d = 23 n = 28657 z = Columns 1 through 15 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 Columns 16 through 23 1597 2584 4181 6765 10946 17711 28657 46368 d = 24 n = 46368 z = Columns 1 through 15 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 Columns 16 through 24 1597 2584 4181 6765 10946 17711 28657 46368 75025 d = 25 n = 75025 z = Columns 1 through 15 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 Columns 16 through 25 1597 2584 4181 6765 10946 17711 28657 46368 75025 121393 d = 26 n = 121393 z = Columns 1 through 15 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 Columns 16 through 26 1597 2584 4181 6765 10946 17711 28657 46368 75025 121393 196418 d = 27 n = 196418 z = Columns 1 through 15 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 Columns 16 through 27 1597 2584 4181 6765 10946 17711 28657 46368 75025 121393 196418 317811 d = 28 n = 317811 z = Columns 1 through 15 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 Columns 16 through 28 1597 2584 4181 6765 10946 17711 28657 46368 75025 121393 196418 317811 514229 d = 29 n = 514229 z = Columns 1 through 15 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 Columns 16 through 29 1597 2584 4181 6765 10946 17711 28657 46368 75025 121393 196418 317811 514229 832040 d = 30 n = 832040 z = Columns 1 through 15 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 Columns 16 through 28 1597 2584 4181 6765 10946 17711 28657 46368 75025 121393 196418 317811 514229 s = 0 s = 2 s = 10 s = 44 s = 188 s = 798 s = 3382 s = 14328 s = 60696 s = 257114