OFFSET
1,3
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000
Casey Mongoven, Description of Stolarsky Representations.
FORMULA
Description of an algorithm for calculating a(n):
Let s(1) = {} be the empty set, and for n > 1, let s(n) be the sequence of digits of a(n). s(n) can be calculated recursively by:
1. If n = round(round(n/phi)*phi) then s(n) = s(floor(n/phi^2) + 1) U {0}, where phi is the golden ratio (A001622) and U denotes concatenation.
2. If n != round(round(n/phi)*phi) then s(n) = s(round(n/phi)) U {1}.
MATHEMATICA
stol[n_] := stol[n] = If[n == 1, {}, If[n != Round[Round[n/GoldenRatio]*GoldenRatio], Join[stol[Floor[n/GoldenRatio^2] + 1], {0}], Join[stol[Round[n/GoldenRatio]], {1}]]];
a[n_] := FromDigits[stol[n]]; Array[a, 100]
PROG
(PARI) stol(n) = {my(phi=quadgen(5)); if(n==1, [], if(n != round(round(n/phi)*phi), concat(stol(floor(n/phi^2) + 1), [0]), concat(stol(round(n/phi)), [1]))); }
a(n) = fromdigits(stol(n));
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Amiram Eldar, Jul 07 2023
STATUS
approved