OFFSET
0,4
COMMENTS
Uses least-greedy algorithm (start with largest possible power of phi, writing a 1 only when required, then work downward).
a(n) is also the left portion of the base-phi representation of n in Knott's representation which uses the least number of 0's, the most 1's, and in which the right-hand portion (see A362919) is finite. - N. J. A. Sloane, May 27 2023
LINKS
Ron Knott, Phigits and the Base Phi representation.
Jeffrey Shallit, Proving Properties of phi-Representations with the Walnut Theorem-Prover, arXiv:2305.02672 [math.NT], 2023. [Note that this document has been revised multiple times.]
EXAMPLE
6 = 111.01101010... in base phi using the least-greedy algorithm. The part to the left of the decimal is a(6) = 111.
PROG
constant (float): phi=(sqrt(5)+1)/2; variable (float): lphi=phi^floor[log(n)/log(phi)]; variable (float): rem=n; variable (integer): count=0; loop: while lphi>1 (count=count*10; lphi=lphi/phi; if(rem > lphi*phi) { rem=rem-lphi; count++; }}
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Graeme McRae, Apr 17 2006
EXTENSIONS
a(1) corrected by N. J. A. Sloane, May 27 2023
STATUS
approved