Function Repository Resource:

# PhiNumberSystem

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

The list consists of nonconsecutive distinct integers that may be 0 or negative.
The input must be a nonzero integer.
ResourceFunction["PhiNumberSystem"][n] discards the sign of n.

## Examples

### Basic Examples (2)

This gives the golden ratio powers needed to represent 10:

 In[1]:=
 Out[1]=

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

 In[2]:=
 Out[2]=
 In[3]:=
 Out[3]=

### Scope (2)

Here are the base-ϕ representations of the first 20 natural numbers:

 In[4]:=
 Out[4]=

A large example:

 In[5]:=
 Out[5]=

Check that the corresponding powers of ϕ sum to the original number:

 In[6]:=
 Out[6]=

### Possible Issues (1)

PhiNumberSystem[n] is left unevaluated for n=0:

 In[7]:=
 Out[7]=

### Neat Examples (1)

The sequence of the sums of the lists looks fractal:

 In[8]:=
 Out[8]=

George Beck

## Requirements

Wolfram Language 11.3 (March 2018) or above

## Version History

• 2.0.0 – 25 January 2021
• 1.0.0 – 26 February 2019