Cody

# Problem 2423. Integer Sequence - II : New Fibonacci

Solution 2045182

Submitted on 4 Dec 2019 by Michael Koscelník
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
assert(isequal(newFibo(1),1))

a = 1 b = 1 f = 1 a = 1 b = 1 y = 1

2   Pass
assert(isequal(newFibo(2),1))

a = 1 b = 1 f = 1 a = 1 b = 1 y = 1

3   Pass
assert(isequal(newFibo(3),1))

a = 1 b = 1 f = 2 a = 1 b = 2 a = 1 b = 1 y = 1

4   Pass
assert(isequal(newFibo(4),2))

a = 1 b = 1 f = 2 a = 1 b = 2 f = 3 a = 2 b = 3 a = 1 b = 1 y = 2 a = 1 b = 2

5   Pass
assert(isequal(newFibo(5),5))

a = 1 b = 1 f = 2 a = 1 b = 2 f = 3 a = 2 b = 3 f = 5 a = 3 b = 5 a = 1 b = 1 y = 2 a = 1 b = 2 y = 3 a = 2 b = 3 y = 5 a = 3 b = 5

6   Pass
assert(isequal(newFibo(6),21))

a = 1 b = 1 f = 2 a = 1 b = 2 f = 3 a = 2 b = 3 f = 5 a = 3 b = 5 f = 8 a = 5 b = 8 a = 1 b = 1 y = 2 a = 1 b = 2 y = 3 a = 2 b = 3 y = 5 a = 3 b = 5 y = 8 a = 5 b = 8 y = 13 a = 8 b = 13 y = 21 a = 13 b = 21

7   Pass
assert(isequal(newFibo(8),10946))

a = 1 b = 1 f = 2 a = 1 b = 2 f = 3 a = 2 b = 3 f = 5 a = 3 b = 5 f = 8 a = 5 b = 8 f = 13 a = 8 b = 13 f = 21 a = 13 b = 21 a = 1 b = 1 y = 2 a = 1 b = 2 y = 3 a = 2 b = 3 y = 5 a = 3 b = 5 y = 8 a = 5 b = 8 y = 13 a = 8 b = 13 y = 21 a = 13 b = 21 y = 34 a = 21 b = 34 y = 55 a = 34 b = 55 y = 89 a = 55 b = 89 y = 144 a = 89 b = 144 y = 233 a = 144 b = 233 y = 377 a = 233 b = 377 y = 610 a = 377 b = 610 y = 987 a = 610 b = 987 y = 1597 a = 987 b = 1597 y = 2584 a = 1597 b = 2584 y = 4181 a = 2584 b = 4181 y = 6765 a = 4181 b = 6765 y = 10946 a = 6765 b = 10946

8   Pass
assert(isequal(newFibo(9),5702887))

a = 1 b = 1 f = 2 a = 1 b = 2 f = 3 a = 2 b = 3 f = 5 a = 3 b = 5 f = 8 a = 5 b = 8 f = 13 a = 8 b = 13 f = 21 a = 13 b = 21 f = 34 a = 21 b = 34 a = 1 b = 1 y = 2 a = 1 b = 2 y = 3 a = 2 b = 3 y = 5 a = 3 b = 5 y = 8 a = 5 b = 8 y = 13 a = 8 b = 13 y = 21 a = 13 b = 21 y = 34 a = 21 b = 34 y = 55 a = 34 b = 55 y = 89 a = 55 b = 89 y = 144 a = 89 b = 144 y = 233 a = 144 b = 233 y = 377 a = 233 b = 377 y = 610 a = 377 b = 610 y = 987 a = 610 b = 987 y = 1597 a = 987 b = 1597 y = 2584 a = 1597 b = 2584 y = 4181 a = 2584 b = 4181 y = 6765 a = 4181 b = 6765 y = 10946 a = 6765 b = 10946 y = 17711 a = 10946 b = 17711 y = 28657 a = 17711 b = 28657 y = 46368 a = 28657 b = 46368 y = 75025 a = 46368 b = 75025 y = 121393 a = 75025 b = 121393 y = 196418 a = 121393 b = 196418 y = 317811 a = 196418 b = 317811 y = 514229 a = 317811 b = 514229 y = 832040 a = 514229 b = 832040 y = 1346269 a = 832040 b = 1346269 y = 2178309 a = 1346269 b = 2178309 y = 3524578 a = 2178309 b = 3524578 y = 5702887 a = 3524578 b = 5702887