OFFSET
1,2
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000
FORMULA
EXAMPLE
a(6) = 4 because the 6th 3-smooth number is A003586(6) = 8, and 4 iterations of phi are needed to reach 1: 8 -> 4 -> 2 -> 1.
MATHEMATICA
f[n_] := Module[{e2 = IntegerExponent[n, 2], e3 = IntegerExponent[n, 3]}, e2 + e3 + 1 + Boole[e2 == 0]]; f[1] = 1; With[{max = 3*10^4}, f /@ Sort[Flatten[Table[2^i*3^j, {i, 0, Log2[max]}, {j, 0, Log[3, max/2^i]}]]]]
PROG
(PARI) list(lim) = {my(e2, e3); print1(1, ", "); for(k = 2, lim, e2 = valuation(k, 2); e3 = valuation(k, 3); if(k == (1 << e2) * 3^e3, print1(e2 + e3 + 1 + (e2 == 0), ", "))); }
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Amiram Eldar, Dec 19 2024
STATUS
approved