A364127 The number of trailing 0's in the Stolarsky representation of n (A364121).
0, 0, 1, 0, 0, 1, 0, 2, 0, 0, 1, 0, 1, 0, 0, 2, 0, 0, 1, 0, 3, 0, 0, 1, 0, 1, 0, 0, 2, 0, 0, 1, 0, 2, 0, 0, 1, 0, 0, 1, 0, 3, 0, 0, 1, 0, 1, 0, 0, 2, 0, 0, 1, 0, 4, 0, 0, 1, 0, 0, 1, 0, 2, 0, 0, 1, 0, 2, 0, 0, 1, 0, 0, 1, 0, 3, 0, 0, 1, 0, 1, 0, 0, 2, 0, 0, 1
Offset: 2
Links
- Amiram Eldar, Table of n, a(n) for n = 2..10000
Programs
-
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_] := IntegerExponent[FromDigits[stol[n]], 10]; Array[a, 100, 2]
-
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) = valuation(fromdigits(stol(n)), 10);
Comments