A347037 The length of the sequence before a repeated number appears, or -1 if a repeat never occurs, starting at k = n for the iterative cycle k -> sigma(k) - k if k is even, k -> sigma(k) if k is odd, where sigma(k) = sum of divisors of k.
1, 2, 2, 2, 2, 1, 2, 2, 6, 3, 245, 244, 5, 4, 242, 243, 5, 4, 7, 6, 3, 5, 242, 241, 3, 244, 5, 1, 22, 21, 2, 8, 7, 8, 240, 7, 6, 6, 4, 21, 20, 4, 18, 245, 8, 7, 8, 4, 239, 246, 20, 19, 239, 5, 7, 3, 12, 11, 9, 8, 5, 5, 468, 18, 5, 4, 471, 6, 239, 238, 6, 5, 13, 6, 471, 17, 7, 6, 14, 5, 468
Offset: 1
Keywords
Examples
a(3) = 2 as 3 -> 4 -> 3. Similarly for all other Mersenne primes. a(5) = 2 as 5 -> 6 -> 6. Similarly for all other primes one less than a perfect number. a(6) = 1 as 6 -> 6. Similarly for all other even perfect numbers. a(11) = 245 as 11 -> 12 -> 16 -> 15 -> 24 -> (233 more terms) -> 230 -> 202 -> 104 -> 106 -> 56 -> 64 -> 63 -> 104, ending with the five-member loop. a(19) = 7 as 19 -> 20 -> 22 -> 14 -> 10 -> 8 -> 7 -> 8. a(27) = 5 as 27 -> 40 -> 50 -> 43 -> 44 -> 40, ending with the four-member loop. a(847) = 5 as 847 -> 1064 -> 1336 -> 1184 -> 1210 -> 1184, ending with the second smallest amicable pair.
Links
- Wikipedia, Aliquot sequence
- P. Zimmermann, Aliquot Sequences
Programs
-
Mathematica
Table[t=k=0;lst={n};k=If[OddQ@n,DivisorSigma[1,n],DivisorSigma[1,n]-n];While[FreeQ[lst,k],AppendTo[lst,k];n=k;t++;k=If[OddQ@n,DivisorSigma[1,n],DivisorSigma[1,n]-n]];t+1,{n,100}] (* Giorgos Kalogeropoulos, Aug 14 2021 *)
Comments