This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A098007 #87 Feb 16 2025 08:32:54 %S A098007 2,3,3,4,3,1,3,4,5,5,3,8,3,6,6,7,3,5,3,8,4,7,3,6,2,8,4,1,3,16,3,4,7,9, %T A098007 4,5,3,8,4,5,3,15,3,6,8,9,3,7,5,4,5,10,3,14,4,6,4,5,3,12,3,10,4,5,4, %U A098007 13,3,6,5,7,3,10,3,6,6,6,4,12,3,8,6,7,3,7,4,10,8,8,3,11,5,7,5,5,3,10,3,4,5,6 %N A098007 Length of aliquot sequence for n, or -1 if aliquot sequence never cycles. %C A098007 The aliquot sequence for n is the trajectory of n under repeated application of the map x -> sigma(x) - x (= A001065). %C A098007 The trajectory will either have a transient part followed by a cyclic part, or will have an infinite transient part and never cycle. It seems possible that this be the case for 276, i.e., a(276) = -1. %C A098007 Sequence gives number of distinct terms in the trajectory = (length of transient part of trajectory) + (length of cycle (which is 1 if the trajectory reached 0)), or -1 if the sequence never cycles. %C A098007 Concerning one of the previously unsolved cases, _Robert G. Wilson v_ reports that 840 reaches 0 after 749 iterations. - Sep 10 2004 %C A098007 Up to 1000 there are 12 numbers whose fate is currently unknown, namely five well-known hard cases: 276, 552, 564, 660, 966 and seven others: 306, 396 and 696, all on same trajectory as 276; 780, on same trajectory as 564; 828, on same trajectory as 660; 888, on same trajectory as 552; 996, on same trajectory as 660. - _T. D. Noe_, Jun 06 2006 %C A098007 The sum-of-divisors function sigma (A000203) and thus aliquot parts A001065 are defined only on the positive integers, so the trajectory ends when 0 is reached. Some authors define A001065 to be the sum of the positive numbers less than n that divide n, in which case one would have A001065(0) = 0. - _M. F. Hasler_, Nov 16 2013 %D A098007 K. Chum, R. K. Guy, M. J. Jacobson, Jr., and A. S. Mosunov, Numerical and statistical analysis of aliquot sequences. Exper. Math. 29 (2020), no. 4, 414-425; arXiv:2110.14136, Oct. 2021 [math.NT]. %D A098007 J.-P. Delahaye, Les inattendus mathématiques, Chapter 19, "Nombres amiables et suites aliquotes", pp. 217-229, Belin-Pour la Science, Paris 2004. %D A098007 G. Everest, A. van der Poorten, I. Shparlinski and T. Ward, Recurrence Sequences, Amer. Math. Soc., 2003; see esp. p. 255. %D A098007 R. K. Guy, Unsolved Problems in Number Theory, B6. %D A098007 R. K. Guy and J. L. Selfridge, Interim report on aliquot series, pp. 557-580 of Proceedings Manitoba Conference on Numerical Mathematics. University of Manitoba, Winnipeg, Oct 1971. %D A098007 Carl Pomerance, The aliquot constant, after Bosma and Kane, Q. J. Math. 69 (2018), no. 3, 915-930. %H A098007 T. D. Noe and N. J. A. Sloane, <a href="/A098007/b098007.txt">Table of n, a(n) for n = 1..275</a> %H A098007 Christophe Clavier, <a href="http://christophe.clavier.free.fr/Aliquot/site/Aliquot.html">Aliquot Sequences</a> %H A098007 Paul Erdős, Andrew Granville, Carl Pomerance and Claudia Spiro, <a href="http://math.dartmouth.edu/~carlp/iterate.pdf">On the normal behavior of the iterates of some arithmetic functions</a>, Analytic number theory, Birkhäuser Boston, 1990, pp. 165-204. %H A098007 Paul Erdos, Andrew Granville, Carl Pomerance and Claudia Spiro, <a href="/A000010/a000010_1.pdf">On the normal behavior of the iterates of some arithmetic functions</a>, Analytic number theory, Birkhäuser Boston, 1990, pp. 165-204. [Annotated copy with A-numbers] %H A098007 T. D. Noe and N. J. A. Sloane, <a href="/A098007/a098007.txt">Table of n, a(n) for n = 1..1000 with "NA" for unknown terms</a> %H A098007 Passawan Noppakaew and Prapanpong Pongsriiam, <a href="https://cs.uwaterloo.ca/journals/JIS/VOL26/Pongsriiam/pong43.html">Product of Some Polynomials and Arithmetic Functions</a>, J. Int. Seq. (2023) Vol. 26, Art. 23.9.1. %H A098007 N. J. A. Sloane, <a href="https://arxiv.org/abs/2301.03149">"A Handbook of Integer Sequences" Fifty Years Later</a>, arXiv:2301.03149 [math.NT], 2023, p. 14. %H A098007 Juan L. Varona, <a href="http://www.unirioja.es/dptos/dmc/jvarona/aliquot.html">List of "primitive" numbers not known to terminate</a> (Oct 19 2004: list begins 276, 552, 564, 660, 966, 1074, 1134, 1464, 1476, 1488, 1512, 1560, 1578, 1632, 1734, 1920, 1992, ...) [This is not the full list of numbers not known to terminate - see Comments above] %H A098007 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/AliquotSequence.html">Aliquot Sequence.</a> %H A098007 Wikipedia, <a href="http://en.wikipedia.org/wiki/Aliquot_sequence">Aliquot sequence</a> %H A098007 P. Zimmermann, <a href="http://www.loria.fr/~zimmerma/records/aliquot.html">Aliquot Sequences</a> %H A098007 <a href="/index/Al#ALIQUOT">Index entries for sequences related to aliquot parts</a>. %e A098007 Examples of trajectories: %e A098007 1, 0. %e A098007 2, 1, 0. %e A098007 3, 1, 0. (and similarly for any prime) %e A098007 4, 3, 1, 0. %e A098007 5, 1, 0. %e A098007 6, 6, 6, ... (and similarly for any perfect number) %e A098007 8, 7, 1, 0. %e A098007 9, 4, 3, 1, 0. %e A098007 12, 16, 15, 9, 4, 3, 1, 0. %e A098007 14, 10, 8, 7, 1, 0. %e A098007 25, 6, 6, 6, ... %e A098007 28, 28, 28, ... (the next perfect number) %e A098007 30, 42, 54, 66, 78, 90, 144, 259, 45, 33, 15, 9, 4, 3, 1, 0. %e A098007 42, 54, 66, 78, 90, 144, 259, 45, 33, 15, 9, 4, 3, 1, 0. %p A098007 f:=proc(n) local t1, i,j,k; t1:=[n]; for i from 2 to 50 do j:= t1[i-1]; k:=sigma(j)-j; t1:=[op(t1), k]; od: t1; end; # produces trajectory for n %p A098007 # 2nd implementation: %p A098007 A098007 := proc(n) %p A098007 local trac, x; %p A098007 x := n ; %p A098007 trac := [x] ; %p A098007 while true do %p A098007 x := numtheory[sigma](x)-trac[-1] ; %p A098007 if x = 0 then %p A098007 return 1+nops(trac) ; %p A098007 elif x in trac then %p A098007 return nops(trac) ; %p A098007 end if; %p A098007 trac := [op(trac), x] ; %p A098007 end do: %p A098007 end proc: %p A098007 seq(A098007(n), n=1..100) ; # _R. J. Mathar_, Oct 08 2017 %t A098007 g[n_] := If[n > 0, DivisorSigma[1, n] - n, 0]; f[n_] := NestWhileList[g, n, UnsameQ, All]; Table[ Length[ f[n]] - 1, {n, 100}] (* _Robert G. Wilson v_, Sep 10 2004 *) %o A098007 (Scheme) %o A098007 (define (A098007 n) (let loop ((visited (list n)) (i 1)) (let ((next (A001065 (car visited)))) (cond ((zero? next) (+ 1 i)) ((member next visited) i) (else (loop (cons next visited) (+ 1 i))))))) %o A098007 (define (A001065 n) (- (A000203 n) n)) ;; For an implementation of A000203, see under that entry. %o A098007 ;; _Antti Karttunen_, Nov 01 2017 %o A098007 (PARI) apply( {A098007(n, t=0)=until(bittest(t,if(n,n=sigma(n)-n)),t+=1<<n);hammingweight(t)}, [1..99]) \\ _M. F. Hasler_, Feb 24 2018, improved Aug 14 2022 thanks to a remark from _Jianing Song_ %o A098007 (Python) %o A098007 from sympy import divisor_sigma as sigma %o A098007 def a(n, limit=float('inf')): %o A098007 alst = []; seen = set(); i = n; c = 0 %o A098007 while i and i not in seen and c < limit: %o A098007 alst.append(i); seen.add(i); i = sigma(i) - i; c += 1 %o A098007 return "NA" if c == limit else len(set(alst + [i])) %o A098007 print([a(n) for n in range(1, 101)]) # _Michael S. Branicky_, Jul 11 2021 %Y A098007 Cf. A001065. %Y A098007 There are many related sequences: %Y A098007 Length of transient part + length of cycle: this sequence. Other versions of the current sequence: A044050, A003023. %Y A098007 Length of transient part: A098008, also A007906. Records for transients: A098009, A098010. %Y A098007 Numbers which eventually reach 1 (or equivalently 0): A080907. %Y A098007 Aliquot trajectories for certain interesting starting values: A008885 (for 30), A008886 A008887 A008888 A008889 A008890 A008891 A008892 (for 276), A014360 A014361 A074907 A014362 A045477 A014363 A014364 A014365 A074906, A171103. %Y A098007 For n < 220, A098008 = A098007 - 1, i.e., 220 is the first sociable number. - _Robert G. Wilson v_, Sep 10 2004 %K A098007 nonn,easy,nice %O A098007 1,1 %A A098007 _N. J. A. Sloane_, Sep 09 2004 %E A098007 More terms from _Robert G. Wilson v_ and _John W. Layman_, Sep 10 2004