Cody

Problem 2423. Integer Sequence - II : New Fibonacci

Solution 2081244

Submitted on 6 Jan 2020 by Ryo Ishido
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))

c = 1 c = 1

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

c = 1 c = 2 c = 1

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

c = 1 c = 2 c = 3 c = 1 c = 2

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

c = 1 c = 2 c = 3 c = 4 c = 1 c = 2 c = 3

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

c = 1 c = 2 c = 3 c = 4 c = 5 c = 1 c = 2 c = 3 c = 4 c = 5

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

c = 1 c = 2 c = 3 c = 4 c = 5 c = 6 c = 1 c = 2 c = 3 c = 4 c = 5 c = 6 c = 7 c = 8

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

c = 1 c = 2 c = 3 c = 4 c = 5 c = 6 c = 7 c = 8 c = 1 c = 2 c = 3 c = 4 c = 5 c = 6 c = 7 c = 8 c = 9 c = 10 c = 11 c = 12 c = 13 c = 14 c = 15 c = 16 c = 17 c = 18 c = 19 c = 20 c = 21

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

c = 1 c = 2 c = 3 c = 4 c = 5 c = 6 c = 7 c = 8 c = 9 c = 1 c = 2 c = 3 c = 4 c = 5 c = 6 c = 7 c = 8 c = 9 c = 10 c = 11 c = 12 c = 13 c = 14 c = 15 c = 16 c = 17 c = 18 c = 19 c = 20 c = 21 c = 22 c = 23 c = 24 c = 25 c = 26 c = 27 c = 28 c = 29 c = 30 c = 31 c = 32 c = 33 c = 34