Wolfram Research

Function Repository Resource:

PhiNumberSystem

Source Notebook

Get a list of powers of the golden ratio which sum to a given integer

Contributed by: Wolfram Staff

ResourceFunction["PhiNumberSystem"][n]

gives the list {x1,x2,,xk} such that ϕx1 + ϕx2 + + ϕxk = n, where ϕ is GoldenRatio.

Details and Options

The list consists of nonconsecutive distinct integers that may be 0 or negative.
The input must be a positive integer.

Examples

Basic Examples

This gives the golden ratio powers needed to represent 10:

In[1]:=
ResourceFunction["PhiNumberSystem"][10]
Out[1]=

Indeed, the sum of those powers of ϕ is 10:

In[2]:=
Total[GoldenRatio^%]
Out[2]=
In[3]:=
FullSimplify@%
Out[3]=

Scope

Here are the representations of the first 20 integers:

In[4]:=
Column[ResourceFunction["PhiNumberSystem"] /@ Range[20]]
Out[4]=

Neat Examples

The sequence of lists seems to be fractal:

In[5]:=
ListLinePlot[
 Total /@ ResourceFunction["PhiNumberSystem"] /@ Range[800]]
Out[5]=

Requirements

Wolfram Language 11.3 (March 2018) or above

Resource History

License Information