Cody

# Problem 2423. Integer Sequence - II : New Fibonacci

Solution 1880584

Submitted on 22 Jul 2019 by Panggah Prabawa
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))

coun = 1 coun = 1 1 coun = 1 1 2 coun = 1 1 2 3 coun = 1 1 2 3 5 coun = 1 1 2 3 5 8 coun = 1 1 2 3 5 8 13 coun = 1 1 2 3 5 8 13 21 coun = 1 1 2 3 5 8 13 21 34

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

coun = 1 coun = 1 1 coun = 1 1 2 coun = 1 1 2 3 coun = 1 1 2 3 5 coun = 1 1 2 3 5 8 coun = 1 1 2 3 5 8 13 coun = 1 1 2 3 5 8 13 21 coun = 1 1 2 3 5 8 13 21 34

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

coun = 1 coun = 1 1 coun = 1 1 2 coun = 1 1 2 3 coun = 1 1 2 3 5 coun = 1 1 2 3 5 8 coun = 1 1 2 3 5 8 13 coun = 1 1 2 3 5 8 13 21 coun = 1 1 2 3 5 8 13 21 34

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

coun = 1 coun = 1 1 coun = 1 1 2 coun = 1 1 2 3 coun = 1 1 2 3 5 coun = 1 1 2 3 5 8 coun = 1 1 2 3 5 8 13 coun = 1 1 2 3 5 8 13 21 coun = 1 1 2 3 5 8 13 21 34

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

coun = 1 coun = 1 1 coun = 1 1 2 coun = 1 1 2 3 coun = 1 1 2 3 5 coun = 1 1 2 3 5 8 coun = 1 1 2 3 5 8 13 coun = 1 1 2 3 5 8 13 21 coun = 1 1 2 3 5 8 13 21 34

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

coun = 1 coun = 1 1 coun = 1 1 2 coun = 1 1 2 3 coun = 1 1 2 3 5 coun = 1 1 2 3 5 8 coun = 1 1 2 3 5 8 13 coun = 1 1 2 3 5 8 13 21 coun = 1 1 2 3 5 8 13 21 34

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

coun = 1 coun = 1 1 coun = 1 1 2 coun = 1 1 2 3 coun = 1 1 2 3 5 coun = 1 1 2 3 5 8 coun = 1 1 2 3 5 8 13 coun = 1 1 2 3 5 8 13 21 coun = 1 1 2 3 5 8 13 21 34

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

coun = 1 coun = 1 1 coun = 1 1 2 coun = 1 1 2 3 coun = 1 1 2 3 5 coun = 1 1 2 3 5 8 coun = 1 1 2 3 5 8 13 coun = 1 1 2 3 5 8 13 21 coun = 1 1 2 3 5 8 13 21 34