OFFSET
1,12
COMMENTS
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000
FORMULA
EXAMPLE
a(n) = 0 if the iterations that start at n are entering a cycle. Examples of cycles are:
1) Cycles of length 1: the triperfect numbers (A005820), 120, 672, 523776, ..., which are the fixed points of A033880. The triperfect numbers can be reached from other values of n, e.g., 276, 448, 486, 510, 702, ... .
2) Cycles of length 2: the only known cycle is (45840, 51168) (see A069085). It can be reached from other values of n, e.g., 32130, 39420, 45480, 66300, ... .
3) Cycles of length 3: the least cycle is (243732672, 271303776, 256786848). It is first reached from n = 107689320.
4) Cycles of length 4: the least cycle is (65071776, 82842816, 89761152, 77260656). It can be reached from other values of n, e.g., 33623940, 41132280, 42825888, ... . The next cycle of length 4 is (985948800, 1381340160, 2183133696, 1489384608).
MATHEMATICA
ab[n_] := Module[{k}, If[n < 1, 0, k = DivisorSigma[1, n] - 2*n; If[k < 1, 0, k]]]; a[n_] := Module[{s = NestWhileList[ab, n, UnsameQ, All]}, If[s[[-1]] == 0, Length[s] - 2, 0]]; Array[a, 120]
PROG
(PARI) ab(n) = {my(k); if(n < 1, 0, k = sigma(n) - 2*n; if(k < 1, 0, k)); }
a(n) = {my(t = 0); until(bittest(t, n = ab(n)), t += 1<<n); if(n == 0, hammingweight(t) - 1, 0); } \\ after M. F. Hasler at A098007
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Amiram Eldar, Apr 12 2024
STATUS
approved