A342718 a(1) = 0; for n >= 2, a(n) is the number of iterations needed for the map x -> A000203(x)/A000005(x) to reach a number that is not an integer, when starting from x = n.
0, 1, 2, 1, 3, 3, 2, 1, 1, 1, 4, 1, 3, 4, 4, 1, 2, 1, 2, 3, 2, 2, 2, 1, 1, 1, 2, 1, 5, 2, 2, 1, 2, 1, 2, 1, 3, 5, 5, 1, 3, 2, 3, 5, 4, 2, 2, 1, 3, 1, 2, 1, 3, 5, 2, 5, 4, 1, 3, 5, 3, 2, 1, 1, 3, 2, 2, 3, 2, 2, 2, 1, 4, 1, 1, 1, 2, 3, 2, 1, 1, 1
Offset: 1
Keywords
Examples
n = 3; 3 -> s(3)/d(3) = 2 -> s(2)/d(2) = 3/2, a(3) = 2; n = 11; 11 -> s(11)/d(11) = 6 -> s(6)/d(6) = 3 -> s(3)/d(3) = 2 -> s(2)/d(2) = 3/2, a(11) = 4; n = 20; 20 -> s(20)/d(20) = 7 -> s(7)/d(7) = 4 -> s(4)/d(4) = 7/3, a(20) = 3; s(x) = A000203(x), d(x) = A000005(x).
Programs
-
Mathematica
f[n_] := Divide @@ DivisorSigma[{1, 0}, n]; a[n_] := Length @ NestWhileList[f, n, IntegerQ[#] && # > 1 &] - 1; Array[a, 100] (* Amiram Eldar, Mar 19 2021 *)
-
PARI
a(n) = if (n==1, 0, my(nb=1, k); while(denominator(k=sigma(n)/numdiv(n)) == 1, n = k; nb++); nb); \\ Michel Marcus, Mar 21 2021
Comments