Cody

Solution 1875635

Submitted on 16 Jul 2019 by Fabrice Yvan Ibrahim Mengoua
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
n = 1; f_correct = 1; assert(isequal(fib_decomposition(n),f_correct))

f = 1

2   Pass
n = 4; f_correct = [1 3]; assert(isequal(fib_decomposition(n),f_correct))

f = 1 1 2 3 i = 1 l = 3 k = 3 f = 1 1 3 f = 1 1 3 i = 2 l = 1 3 k = 1 f = 1 3 f = 1 3

3   Pass
n = 6; f_correct = [1 5]; assert(isequal(fib_decomposition(n),f_correct))

f = 1 1 2 3 5 i = 1 l = 5 k = 3 f = 1 1 5 f = 1 1 5 i = 2 l = 1 5 k = 1 f = 1 5 f = 1 5

4   Pass
n = 2010; f_correct = [2 34 377 1597]; assert(isequal(fib_decomposition(n),f_correct))

f = Columns 1 through 14 1 1 2 3 5 8 13 21 34 55 89 144 233 377 Columns 15 through 17 610 987 1597 i = 1 l = 1597 k = 15 f = Columns 1 through 14 1 1 2 3 5 8 13 21 34 55 89 144 233 377 Column 15 1597 f = Columns 1 through 14 1 1 2 3 5 8 13 21 34 55 89 144 233 377 Column 15 1597 i = 2 l = 377 1597 k = 10 f = 1 1 2 3 5 8 13 21 34 377 1597 f = 1 1 2 3 5 8 13 21 34 377 1597 i = 3 l = 34 377 1597 k = 4 f = 1 1 2 34 377 1597 f = 1 1 2 34 377 1597 i = 4 l = 2 34 377 1597 k = 1 f = 2 34 377 1597 f = 2 34 377 1597

5   Pass
n = 35601; f_correct = [1 34 144 6765 28657]; assert(isequal(fib_decomposition(n),f_correct))

f = Columns 1 through 14 1 1 2 3 5 8 13 21 34 55 89 144 233 377 Columns 15 through 23 610 987 1597 2584 4181 6765 10946 17711 28657 i = 1 l = 28657 k = 21 f = Columns 1 through 14 1 1 2 3 5 8 13 21 34 55 89 144 233 377 Columns 15 through 21 610 987 1597 2584 4181 6765 28657 f = Columns 1 through 14 1 1 2 3 5 8 13 21 34 55 89 144 233 377 Columns 15 through 21 610 987 1597 2584 4181 6765 28657 i = 2 l = 6765 28657 k = 13 f = 1 1 2 3 5 8 13 21 34 55 89 144 6765 28657 f = 1 1 2 3 5 8 13 21 34 55 89 144 6765 28657 i = 3 l = 144 6765 28657 k = 10 f = 1 1 2 3 5 8 13 21 34 144 6765 28657 f = 1 1 2 3 5 8 13 21 34 144 6765 28657 i = 4 l = 34 144 6765 28657 k = 3 f = 1 1 34 144 6765 28657 f = 1 1 34 144 6765 28657 i = 5 l = 1 34 144 6765 28657 k = 1 f = 1 34 144 6765 28657 f = 1 34 144 6765 28657

6   Pass
n = 9227467; f_correct = [2 9227465]; assert(isequal(fib_decomposition(n),f_correct))

f = Columns 1 through 14 1 1 2 3 5 8 13 21 34 55 89 144 233 377 Columns 15 through 28 610 987 1597 2584 4181 6765 10946 17711 28657 46368 75025 121393 196418 317811 Columns 29 through 35 514229 832040 1346269 2178309 3524578 5702887 9227465 i = 1 l = 9227465 k = 4 f = 1 1 2 9227465 f = 1 1 2 9227465 i = 2 l = 2 9227465 k = 1 f = 2 9227465 f = 2 9227465

7   Pass
n = 2015; f_correct = [2 5 34 377 1597]; assert(isequal(fib_decomposition(n),f_correct))

f = Columns 1 through 14 1 1 2 3 5 8 13 21 34 55 89 144 233 377 Columns 15 through 17 610 987 1597 i = 1 l = 1597 k = 15 f = Columns 1 through 14 1 1 2 3 5 8 13 21 34 55 89 144 233 377 Column 15 1597 f = Columns 1 through 14 1 1 2 3 5 8 13 21 34 55 89 144 233 377 Column 15 1597 i = 2 l = 377 1597 k = 10 f = 1 1 2 3 5 8 13 21 34 377 1597 f = 1 1 2 3 5 8 13 21 34 377 1597 i = 3 l = 34 377 1597 k = 6 f = 1 1 2 3 5 34 377 1597 f = 1 1 2 3 5 34 377 1597 i = 4 l = 5 34 377 1597 k = 4 f = 1 1 2 5 34 377 1597 f = 1 1 2 5 34 377 1597 i = 5 l = 2 5 34 377 1597 k = 1 f = 2 5 34 377 1597 f = 2 5 34 377 1597