Cody

Problem 47058. Determine the Zeckendorf expansion of a number

Solution 3364753

Submitted on 24 Oct 2020 by Giovanni Mottola
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 = 26; y_correct = [21 5]; assert(isequal(Zeckendorf(x),y_correct))

s = 1 1 2 s = 1 1 2 3 s = 1 1 2 3 5 s = 1 1 2 3 5 8 s = 1 1 2 3 5 8 13 s = 1 1 2 3 5 8 13 21 s = 1 1 2 3 5 8 13 21 34 o = 34 o = 21 c = 21 n = 5 o = 13 o = 8 o = 5 c = 21 5 n = 0 o = 3 o = 2 o = 1 o = 1

2   Pass
x = 26; y_correct = [21 5]; assert(isequal(Zeckendorf(x),y_correct))

s = 1 1 2 s = 1 1 2 3 s = 1 1 2 3 5 s = 1 1 2 3 5 8 s = 1 1 2 3 5 8 13 s = 1 1 2 3 5 8 13 21 s = 1 1 2 3 5 8 13 21 34 o = 34 o = 21 c = 21 n = 5 o = 13 o = 8 o = 5 c = 21 5 n = 0 o = 3 o = 2 o = 1 o = 1

3   Pass
x = 88; y_correct = [55 21 8 3 1]; assert(isequal(Zeckendorf(x),y_correct))

s = 1 1 2 s = 1 1 2 3 s = 1 1 2 3 5 s = 1 1 2 3 5 8 s = 1 1 2 3 5 8 13 s = 1 1 2 3 5 8 13 21 s = 1 1 2 3 5 8 13 21 34 s = 1 1 2 3 5 8 13 21 34 55 s = 1 1 2 3 5 8 13 21 34 55 89 o = 89 o = 55 c = 55 n = 33 o = 34 o = 21 c = 55 21 n = 12 o = 13 o = 8 c = 55 21 8 n = 4 o = 5 o = 3 c = 55 21 8 3 n = 1 o = 2 o = 1 c = 55 21 8 3 1 n = 0 o = 1

4   Pass
x = 965; y_correct = [610 233 89 21 8 3 1]; assert(isequal(Zeckendorf(x),y_correct))

s = 1 1 2 s = 1 1 2 3 s = 1 1 2 3 5 s = 1 1 2 3 5 8 s = 1 1 2 3 5 8 13 s = 1 1 2 3 5 8 13 21 s = 1 1 2 3 5 8 13 21 34 s = 1 1 2 3 5 8 13 21 34 55 s = 1 1 2 3 5 8 13 21 34 55 89 s = 1 1 2 3 5 8 13 21 34 55 89 144 s = 1 1 2 3 5 8 13 21 34 55 89 144 233 s = 1 1 2 3 5 8 13 21 34 55 89 144 233 377 s = 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 s = 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 o = 987 o = 610 c = 610 n = 355 o = 377 o = 233 c = 610 233 n = 122 o = 144 o = 89 c = 610 233 89 n = 33 o = 55 o = 34 o = 21 c = 610 233 89 21 n = 12 o = 13 o = 8 c = 610 233 89 21 8 n = 4 o = 5 o = 3 c = 610 233 89 21 8 3 n = 1 o = 2 o = 1 c = 610 233 89 21 8 3 1 n = 0 o = 1

5   Pass
x = 4180; y_correct = [2584 987 377 144 55 21 8 3 1]; assert(isequal(Zeckendorf(x),y_correct))

s = 1 1 2 s = 1 1 2 3 s = 1 1 2 3 5 s = 1 1 2 3 5 8 s = 1 1 2 3 5 8 13 s = 1 1 2 3 5 8 13 21 s = 1 1 2 3 5 8 13 21 34 s = 1 1 2 3 5 8 13 21 34 55 s = 1 1 2 3 5 8 13 21 34 55 89 s = 1 1 2 3 5 8 13 21 34 55 89 144 s = 1 1 2 3 5 8 13 21 34 55 89 144 233 s = 1 1 2 3 5 8 13 21 34 55 89 144 233 377 s = 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 s = 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 s = 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 s = Columns 1 through 14 1 1 2 3 5 8 13 21 34 55 89 144 233 377 Columns 15 through 18 610 987 1597 2584 s = Columns 1 through 14 1 1 2 3 5 8 13 21 34 55 89 144 233 377 Columns 15 through 19 610 987 1597 2584 4181 o = 4181 o = 2584 c = 2584 n = 1596 o = 1597 o = 987 c = 2584 987 n = 609 o = 610 o = 377 c = 2584 987 377 n = 232 o = 233 o = 144 c = 2584 987 377 144 n = 88 o = 89 o = 55 c = 2584 987 377 144 55 n = 33 o = 34 o = 21 c = 2584 987 377 144 55 21 n = 12 o = 13 o = 8 c = 2584 987 377 144 55 21 8 n = 4 o = 5 o = 3 c = 2584 987 377 144 55 21 8 3 n = 1 o = 2 o = 1 c = 2584 987 377 144 55 21 8 3 1 n = 0 o = 1

6   Pass
x = 75024; y_correct = [46368 17711 6765 2584 987 377 144 55 21 8 3 1]; assert(isequal(Zeckendorf(x),y_correct))

s = 1 1 2 s = 1 1 2 3 s = 1 1 2 3 5 s = 1 1 2 3 5 8 s = 1 1 2 3 5 8 13 s = 1 1 2 3 5 8 13 21 s = 1 1 2 3 5 8 13 21 34 s = 1 1 2 3 5 8 13 21 34 55 s = 1 1 2 3 5 8 13 21 34 55 89 s = 1 1 2 3 5 8 13 21 34 55 89 144 s = 1 1 2 3 5 8 13 21 34 55 89 144 233 s = 1 1 2 3 5 8 13 21 34 55 89 144 233 377 s = 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 s = 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 s = 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 s = Columns 1 through 14 1 1 2 3 5 8 13 21 34 55 89 144 233 377 Columns 15 through 18 610 987 1597 2584 s = Columns 1 through 14 1 1 2 3 5 8 13 21 34 55 89 144 233 377 Columns 15 through 19 610 987 1597 2584 4181 s = Columns 1 through 14 1 1 2 3 5 8 13 21 34 55 89 144 233 377 Columns 15 through 20 610 987 1597 2584 4181 6765 s = 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 10946 s = Columns 1 through 14 1 1 2 3 5 8 13 21 34 55 89 144 233 377 Columns 15 through 22 610 987 1597 2584 4181 6765 10946 17711 s = 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 s = Columns 1 through 14 1 1 2 3 5 8 13 21 34 55 89 144 233 377 Columns 15 through 24 610 987 1597 2584 4181 6765 10946 17711 28657 46368 s = Columns 1 through 14 1 1 2 3 5 8 13 21 34 55 89 144 233 377 Columns 15 through 25 610 987 1597 2584 4181 6765 10946 17711 28657 46368 75025 o = 75025 o = 46368 c = 46368 n = 28656 o = 28657 o = 17711 c = 46368 17711 n = 10945 o = 10946 o = 6765 c = 46368 17711 6765 n = 4180 o = 4181 o = 2584 c = 46368 17711 6765 2584 n = 1596 o = 1597 o = 987 c = 46368 17711 6765 2584 987 n = 609 o = 610 o = 377 c = 46368 17711 6765 2584 987 377 n = 232 o = 233 o = 144 c = 46368 17711 6765 2584 987 377 144 n = 88 o = 89 o = 55 c = 46368 17711 6765 2584 987 377 144 55 n = 33 o = 34 o = 21 c = 46368 17711 6765 2584 987 377 144 55 21 n = 12 o = 13 o = 8 c = 46368 17711 6765 2584 987 377 144 55 21 8 n = 4 o = 5 o = 3 c = 46368 17711 6765 2584 987 377 144 55 21 8 3 n = 1 o = 2 o = 1 c = 46368 17711 6765 2584 987 377 144 55 21 8 3 1 n = 0 o = 1

7   Pass
x = 514228; y_correct = [317811 121393 46368 17711 6765 2584 987 377 144 55 21 8 3 1]; assert(isequal(Zeckendorf(x),y_correct))

s = 1 1 2 s = 1 1 2 3 s = 1 1 2 3 5 s = 1 1 2 3 5 8 s = 1 1 2 3 5 8 13 s = 1 1 2 3 5 8 13 21 s = 1 1 2 3 5 8 13 21 34 s = 1 1 2 3 5 8 13 21 34 55 s = 1 1 2 3 5 8 13 21 34 55 89 s = 1 1 2 3 5 8 13 21 34 55 89 144 s = 1 1 2 3 5 8 13 21 34 55 89 144 233 s = 1 1 2 3 5 8 13 21 34 55 89 144 233 377 s = 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 s = 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 s = 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 s = Columns 1 through 14 1 1 2 3 5 8 13 21 34 55 89 144 233 377 Columns 15 through 18 610 987 1597 2584 s = Columns 1 through 14 1 1 2 3 5 8 13 21 34 55 89 144 233 377 Columns 15 through 19 610 987 1597 2584 4181 s = Columns 1 through 14 1 1 2 3 5 8 13 21 34 55 89 144 233 377 Columns 15 through 20 610 987 1597 2584 4181 6765 s = 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 10946 s = Columns 1 through 14 1 1 2 3 5 8 13 21 34 55 89 144 233 377 Columns 15 through 22 610 987 1597 2584 4181 6765 10946 17711 s = 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 s = Columns 1 through 14 1 1 2 3 5 8 13 21 34 55 89 144 233 377 Columns 15 through 24 610 987 1597 2584 4181 6765 10946 17711 28657 46368 s = Columns 1 through 14 1 1 2 3 5 8 13 21 34 55 89 144 233 377 Columns 15 through 25 610 987 1597 2584 4181 6765 10946 17711 28657 46368 75025 s = Columns 1 through 14 1 1 2 3 5 8 13 21 34 55 89 144 233 377 Columns 15 through 26 610 987 1597 2584 4181 6765 10946 17711 28657 46368 75025 121393 s = Columns 1 through 14 1 1 2 3 5 8 13 21 34 55 89 144 233 377 Columns 15 through 27 610 987 1597 2584 4181 6765 10946 17711 28657 46368 75025 121393 196418 s = 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 s = 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 Column 29 514229 o = 514229 o = 317811 c = 317811 n = 196417 o = 196418 o = 121393 c = 317811 121393 n = 75024 o = 75025 o = 46368 c = 317811 121393 46368 n = 28656 o = 28657 o = 17711 c = 317811 121393 46368 17711 n = 10945 o = 10946 o = 6765 c = 317811 121393 46368 17711 6765 n = 4180 o = 4181 o = 2584 c = 317811 121393 46368 17711 6765 2584 n = 1596 o = 1597 o = 987 c = 317811 121393 46368 17711 6765 2584 987 n = 609 o = 610 o = 377 c = 317811 121393 46368 17711 6765 2584 987 377 n = 232 o = 233 o = 144 c = 317811 121393 46368 17711 6765 2584 987 377 144 n = 88 o = 89 o = 55 c = 317811 121393 46368 17711 6765 2584 987 377 144 55 n = 33 o = 34 o = 21 c = 317811 121393 46368 17711 6765 2584 987 377 144 55 21 n = 12 o = 13 o = 8 c = 317811 121393 46368 17711 6765 2584 987 377 144 55 21 8 n = 4 o = 5 o = 3 c = 317811 121393 46368 17711 6765 2584 987 377 144 55 21 8 3 n = 1 o = 2 o = 1 c = 317811 121393 46368 17711 6765 2584 987 377 144 55 21 8 3 1 n = 0 o = 1

8   Pass
x = 514229; y_correct = 514229; assert(isequal(Zeckendorf(x),y_correct))

s = 1 1 2 s = 1 1 2 3 s = 1 1 2 3 5 s = 1 1 2 3 5 8 s = 1 1 2 3 5 8 13 s = 1 1 2 3 5 8 13 21 s = 1 1 2 3 5 8 13 21 34 s = 1 1 2 3 5 8 13 21 34 55 s = 1 1 2 3 5 8 13 21 34 55 89 s = 1 1 2 3 5 8 13 21 34 55 89 144 s = 1 1 2 3 5 8 13 21 34 55 89 144 233 s = 1 1 2 3 5 8 13 21 34 55 89 144 233 377 s = 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 s = 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 s = 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 s = Columns 1 through 14 1 1 2 3 5 8 13 21 34 55 89 144 233 377 Columns 15 through 18 610 987 1597 2584 s = Columns 1 through 14 1 1 2 3 5 8 13 21 34 55 89 144 233 377 Columns 15 through 19 610 987 1597 2584 4181 s = Columns 1 through 14 1 1 2 3 5 8 13 21 34 55 89 144 233 377 Columns 15 through 20 610 987 1597 2584 4181 6765 s = 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 10946 s = Columns 1 through 14 1 1 2 3 5 8 13 21 34 55 89 144 233 377 Columns 15 through 22 610 987 1597 2584 4181 6765 10946 17711 s = 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 s = Columns 1 through 14 1 1 2 3 5 8 13 21 34 55 89 144 233 377 Columns 15 through 24 610 987 1597 2584 4181 6765 10946 17711 28657 46368 s = Columns 1 through 14 1 1 2 3 5 8 13 21 34 55 89 144 233 377 Columns 15 through 25 610 987 1597 2584 4181 6765 10946 17711 28657 46368 75025 s = Columns 1 through 14 1 1 2 3 5 8 13 21 34 55 89 144 233 377 Columns 15 through 26 610 987 1597 2584 4181 6765 10946 17711 28657 46368 75025 121393 s = Columns 1 through 14 1 1 2 3 5 8 13 21 34 55 89 144 233 377 Columns 15 through 27 610 987 1597 2584 4181 6765 10946 17711 28657 46368 75025 121393 196418 s = 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 s = 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 Column 29 514229 o = 514229 c = 514229 n = 0 o = 317811 o = 196418 o = 121393 o = 75025 o = 46368 o = 28657 o = 17711 o = 10946 o = 6765 o = 4181 o = 2584 o = 1597 o = 987 o = 610 o = 377 o = 233 o = 144 o = 89 o = 55 o = 34 o = 21 o = 13 o = 8 o = 5 o = 3 o = 2 o = 1 o = 1

9   Pass
x = 8675309; y_correct = [5702887 2178309 514229 196418 75025 6765 1597 55 21 3]; assert(isequal(Zeckendorf(x),y_correct))

s = 1 1 2 s = 1 1 2 3 s = 1 1 2 3 5 s = 1 1 2 3 5 8 s = 1 1 2 3 5 8 13 s = 1 1 2 3 5 8 13 21 s = 1 1 2 3 5 8 13 21 34 s = 1 1 2 3 5 8 13 21 34 55 s = 1 1 2 3 5 8 13 21 34 55 89 s = 1 1 2 3 5 8 13 21 34 55 89 144 s = 1 1 2 3 5 8 13 21 34 55 89 144 233 s = 1 1 2 3 5 8 13 21 34 55 89 144 233 377 s = 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 s = 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 s = 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 s = Columns 1 through 14 1 1 2 3 5 8 13 21 34 55 89 144 233 377 Columns 15 through 18 610 987 1597 2584 s = Columns 1 through 14 1 1 2 3 5 8 13 21 34 55 89 144 233 377 Columns 15 through 19 610 987 1597 2584 4181 s = Columns 1 through 14 1 1 2 3 5 8 13 21 34 55 89 144 233 377 Columns 15 through 20 610 987 1597 2584 4181 6765 s = 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 10946 s = Columns 1 through 14 1 1 2 3 5 8 13 21 34 55 89 144 233 377 Columns 15 through 22 610 987 1597 2584 4181 6765 10946 17711 s = 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 s = Columns 1 through 14 1 1 2 3 5 8 13 21 34 55 89 144 233 377 Columns 15 through 24 610 987 1597 2584 4181 6765 10946 17711 28657 46368 s = Columns 1 through 14 1 1 2 3 5 8 13 21 34 55 89 144 233 377 Columns 15 through 25 610 987 1597 2584 4181 6765 10946 17711 28657 46368 75025 s = Columns 1 through 14 1 1 2 3 5 8 13 21 34 55 89 144 233 377 Columns 15 through 26 610 987 1597 2584 4181 6765 10946 17711 28657 46368 75025 121393 s = Columns 1 through 14 1 1 2 3 5 8 13 21 34 55 89 144 233 377 Columns 15 through 27 610 987 1597 2584 4181 6765 10946 17711 28657 46368 75025 121393 196418 s = 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 s = 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 Column 29 514229 s = 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 30 514229 832040 s = 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 31 514229 832040 1346269 s = 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 32 514229 832040 1346269 2178309 s = 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 33 514229 832040 1346269 2178309 3524578 s = 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 34 514229 832040 1346269 2178309 3524578 5702887 s = 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 o = 9227465 o = 5702887 c = 5702887 n = 2972422 o = 3524578 o = 2178309 c = 5702887 2178309 n = 794113 o = 1346269 o = 832040 o = 514229 c = 5702887 2178309 514229 n = 279884 o = 317811 o = 196418 c = 5702887 2178309 514229 196418 n = 83466 o = 121393 o = 75025 c = 5702887 2178309 514229 196418 75025 n = 8441 o = 46368 o = 28657 o = 17711 o = 10946 o = 6765 c = 5702887 2178309 514229 196418 75025 6765 n = 1676 o = 4181 o = 2584 o = 1597 c = 5702887 2178309 514229 196418 75025 6765 1597 n = 79 o = 987 o = 610 o = 377 o = 233 o = 144 o = 89 o = 55 c = 5702887 2178309 514229 196418 75025 6765 1597 55 n = 24 o = 34 o = 21 c = 5702887 2178309 514229 196418 75025 6765 1597 55 21 n = 3 o = 13 o = 8 o = 5 o = 3 c = 5702887 2178309 514229 196418 75025 6765 1597 55 21 3 n = 0 o = 2 o = 1 o = 1

10   Pass
x = 2022243254; y_correct = [1836311903 165580141 14930352 3524578 1346269 514229 28657 6765 233 89 34 3 1]; assert(isequal(Zeckendorf(x),y_correct))

s = 1 1 2 s = 1 1 2 3 s = 1 1 2 3 5 s = 1 1 2 3 5 8 s = 1 1 2 3 5 8 13 s = 1 1 2 3 5 8 13 21 s = 1 1 2 3 5 8 13 21 34 s = 1 1 2 3 5 8 13 21 34 55 s = 1 1 2 3 5 8 13 21 34 55 89 s = 1 1 2 3 5 8 13 21 34 55 89 144 s = 1 1 2 3 5 8 13 21 34 55 89 144 233 s = 1 1 2 3 5 8 13 21 34 55 89 144 233 377 s = 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 s = 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 s = 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 s = Columns 1 through 14 1 1 2 3 5 8 13 21 34 55 89 144 233 377 Columns 15 through 18 610 987 1597 2584 s = Columns 1 through 14 1 1 2 3 5 8 13 21 34 55 89 144 233 377 Columns 15 through 19 610 987 1597 2584 4181 s = Columns 1 through 14 1 1 2 3 5 8 13 21 34 55 89 144 233 377 Columns 15 through 20 610 987 1597 2584 4181 6765 s = 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 10946 s = Columns 1 through 14 1 1 2 3 5 8 13 21 34 55 89 144 233 377 Columns 15 through 22 610 987 1597 2584 4181 6765 10946 17711 s = 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 s = Columns 1 through 14 1 1 2 3 5 8 13 21 34 55 89 144 233 377 Columns 15 through 24 610 987 1597 2584 4181 6765 10946 17711 28657 46368 s = Columns 1 through 14 1 1 2 3 5 8 13 21 34 55 89 144 233 377 Columns 15 through 25 610 987 1597 2584 4181 6765 10946 17711 28657 46368 75025 s = Columns 1 through 14 1 1 2 3 5 8 13 21 34 55 89 144 233 377 Columns 15 through 26 610 987 1597 2584 4181 6765 10946 17711 28657 46368 75025 121393 s = Columns 1 through 14 1 1 2 3 5 8 13 21 34 55 89 144 233 377 Columns 15 through 27 610 987 1597 2584 4181 6765 10946 17711 28657 46368 75025 121393 196418 s = 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 s = 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 Column 29 514229 s = 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 30 514229 832040 s = 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 31 514229 832040 1346269 s = 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 32 514229 832040 1346269 2178309 s = 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 33 514229 832040 1346269 2178309 3524578 s = 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 34 514229 832040 1346269 2178309 3524578 5702887 s = 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 s = 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 36 514229 832040 1346269 2178309 3524578 5702887 9227465 14930352 s = 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 37 514229 832040 1346269 2178309 3524578 5702887 9227465 14930352 24157817 s = 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 38 514229 832040 1346269 2178309 3524578 5702887 9227465 14930352 24157817 39088169 s = 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 ...

11   Pass
x = 314159265358; y_correct = [225851433717 86267571272 1836311903 165580141 24157817 9227465 3524578 1346269 75025 28657 6765 1597 144 8]; assert(isequal(Zeckendorf(x),y_correct))

s = 1 1 2 s = 1 1 2 3 s = 1 1 2 3 5 s = 1 1 2 3 5 8 s = 1 1 2 3 5 8 13 s = 1 1 2 3 5 8 13 21 s = 1 1 2 3 5 8 13 21 34 s = 1 1 2 3 5 8 13 21 34 55 s = 1 1 2 3 5 8 13 21 34 55 89 s = 1 1 2 3 5 8 13 21 34 55 89 144 s = 1 1 2 3 5 8 13 21 34 55 89 144 233 s = 1 1 2 3 5 8 13 21 34 55 89 144 233 377 s = 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 s = 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 s = 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 s = Columns 1 through 14 1 1 2 3 5 8 13 21 34 55 89 144 233 377 Columns 15 through 18 610 987 1597 2584 s = Columns 1 through 14 1 1 2 3 5 8 13 21 34 55 89 144 233 377 Columns 15 through 19 610 987 1597 2584 4181 s = Columns 1 through 14 1 1 2 3 5 8 13 21 34 55 89 144 233 377 Columns 15 through 20 610 987 1597 2584 4181 6765 s = 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 10946 s = Columns 1 through 14 1 1 2 3 5 8 13 21 34 55 89 144 233 377 Columns 15 through 22 610 987 1597 2584 4181 6765 10946 17711 s = 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 s = Columns 1 through 14 1 1 2 3 5 8 13 21 34 55 89 144 233 377 Columns 15 through 24 610 987 1597 2584 4181 6765 10946 17711 28657 46368 s = Columns 1 through 14 1 1 2 3 5 8 13 21 34 55 89 144 233 377 Columns 15 through 25 610 987 1597 2584 4181 6765 10946 17711 28657 46368 75025 s = Columns 1 through 14 1 1 2 3 5 8 13 21 34 55 89 144 233 377 Columns 15 through 26 610 987 1597 2584 4181 6765 10946 17711 28657 46368 75025 121393 s = Columns 1 through 14 1 1 2 3 5 8 13 21 34 55 89 144 233 377 Columns 15 through 27 610 987 1597 2584 4181 6765 10946 17711 28657 46368 75025 121393 196418 s = 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 s = 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 Column 29 514229 s = 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 30 514229 832040 s = 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 31 514229 832040 1346269 s = 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 32 514229 832040 1346269 2178309 s = 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 33 514229 832040 1346269 2178309 3524578 s = 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 34 514229 832040 1346269 2178309 3524578 5702887 s = 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 s = 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 36 514229 832040 1346269 2178309 3524578 5702887 9227465 14930352 s = 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 37 514229 832040 1346269 2178309 3524578 5702887 9227465 14930352 24157817 s = 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 38 514229 832040 1346269 2178309 3524578 5702887 9227465 14930352 24157817 39088169 s = 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 ...

Suggested Problems

More from this Author67

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!