|
|
A200649
|
|
Number of 1's in the Stolarsky representation of n.
|
|
10
|
|
|
0, 1, 2, 1, 3, 2, 2, 4, 1, 3, 3, 3, 5, 2, 2, 4, 2, 4, 4, 4, 6, 1, 3, 3, 3, 5, 3, 3, 5, 3, 5, 5, 5, 7, 2, 2, 4, 2, 4, 4, 4, 6, 2, 4, 4, 4, 6, 4, 4, 6, 4, 6, 6, 6, 8, 1, 3, 3, 3, 5, 3, 3, 5, 3, 5, 5, 5, 7, 3, 3, 5, 3, 5, 5, 5, 7, 3, 5, 5, 5, 7, 5, 5, 7, 5, 7, 7
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,3
|
|
COMMENTS
|
For the Stolarsky representation of n, see the C. Mongoven link.
|
|
LINKS
|
|
|
FORMULA
|
|
|
EXAMPLE
|
The Stolarsky representation of 19 is 11101. This has 4 1's. So a(19) = 4.
|
|
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_] := Count[stol[n], 1]; Array[a, 100] (* Amiram Eldar, Jul 07 2023 *)
|
|
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]))); }
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base,changed
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|