Function Repository Resource:

# ZeckendorfRepresentation

Give the 0–1 list that indicates the unique nonconsecutive Fibonacci numbers that sum to the non-negative integer input

Contributed by: Wolfram Staff
 ResourceFunction["ZeckendorfRepresentation"][n] gives the 0–1 list that indicates the unique nonconsecutive Fibonacci numbers that sum to the non-negative integer n.

## Details and Options

The Fibonacci numbers here are considered to be 1, 2, 3, 5, …, not 1, 1, 2, 3, 5, …; otherwise, the representation would not be unique.

## Examples

### Basic Examples (2)

The first number whose representation takes three summands is 12:

 In[1]:=
 Out[1]=

This corresponds to 8 + 3 + 1:

 In[2]:=
 Out[2]=

The first number whose representation takes four summands is 33:

 In[3]:=
 Out[3]=
 In[4]:=
 Out[4]=

### Neat Examples (2)

 In[5]:=
 Out[5]=

There are Fk Zeckendorf representations of length k; for example, here are the 13 representations of length 7:

 In[6]:=
 Out[6]=

This visualizes the same pattern:

 In[7]:=
 Out[7]=

George Beck

## Requirements

Wolfram Language 11.3 (March 2018) or above

## Version History

• 1.0.0 – 25 February 2019