Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Give the 0–1 list that indicates the unique nonconsecutive Fibonacci numbers that sum to the non-negative integer input
ResourceFunction["ZeckendorfRepresentation"][n] gives the 0–1 list that indicates the unique nonconsecutive Fibonacci numbers that sum to the non-negative integer n. |
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]= |
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]= |
Wolfram Language 11.3 (March 2018) or above
This work is licensed under a Creative Commons Attribution 4.0 International License