A330786 Number of steps to reach 1 by iterating the absolute alternating sum-of-divisors function (A206369).
0, 1, 2, 3, 4, 2, 3, 5, 4, 4, 5, 3, 4, 3, 6, 6, 7, 4, 5, 4, 4, 5, 6, 5, 5, 4, 5, 5, 6, 6, 7, 5, 5, 7, 6, 5, 6, 5, 6, 5, 6, 4, 5, 7, 6, 6, 7, 6, 6, 5, 6, 6, 7, 5, 6, 7, 6, 6, 7, 6, 7, 7, 5, 6, 7, 5, 6, 7, 8, 6, 7, 7, 8, 6, 5, 6, 7, 6, 7, 8, 8, 6, 7, 6, 7, 5, 8, 6, 7, 6
Offset: 1
Keywords
Examples
Iterating A206369 with a starting value of 27 gives 20, 12, 6, 2, 1, taking 5 steps to reach 1. So a(27) = 5.
References
- See A206369.
Crossrefs
Cf. A206369.
Programs
-
Mathematica
f[p_,e_] := Sum[(-1)^(e-k)*p^k, {k,0,e}]; s[1] = 1; s[n_] := Times @@ (f @@@ FactorInteger[n]); a[n_] := Length @ FixedPointList[s, n] - 2; Array[a, 90] (* Amiram Eldar, Jan 01 2020 *)
-
PARI
f(n) = sumdiv(n, d, eulerphi(n/d) * issquare(d)); \\ A206369 a(n) = {if (n==1, return (0)); my(nb = 1); while ((n = f(n)) != 1, nb++); nb;} \\ Michel Marcus, Jan 01 2020
Formula
a(1) = 0; for n > 1, a(n) = 1 + a(A206369(n)).
Comments