OFFSET
1,2
COMMENTS
See A098007 for further information.
a(n) = 0 if and only if n is perfect (A000396) or part of a cycle of length greater than 1. - Comment corrected by Antti Karttunen, Nov 02 2017.
It is believed that the first time a(n) = -1 is at n = 276 (see A008892). - N. J. A. Sloane, Nov 02 2017
REFERENCES
R. K. Guy, Unsolved Problems in Number Theory, B6.
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.
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..275
EXAMPLE
From Antti Karttunen, Nov 02 2017: (Start)
For n = 3, a(n) = 2, because A001065(3) = 1 and A001065(1) = 0, so it took two steps to end in zero.
For n = 25, a(n) = 1, because A001065(25) = 6, and A001065(6) = 6, so it took one step to enter into a cycle.
(End)
MATHEMATICA
g[n_] := If[n > 0, DivisorSigma[1, n] - n, 0]; f[n_] := NestWhileList[g, n, UnsameQ, All]; Table[ Length[ f[n]] - 2, {n, 102}] (* good only for n<220 *) (* Robert G. Wilson v, Sep 10 2004 *)
PROG
(Scheme)
(define (A098008 n) (let loop ((visited (list n)) (i 1)) (let ((next (A001065 (car visited)))) (cond ((zero? next) i) ((member next visited) => (lambda (transientplus1) (- (length transientplus1) 1))) (else (loop (cons next visited) (+ 1 i))))))) ;; Good for at least n = 1..275.
;; Antti Karttunen, Nov 02 2017
CROSSREFS
KEYWORD
nonn,easy,nice
AUTHOR
N. J. A. Sloane, Sep 09 2004
EXTENSIONS
More terms from Robert G. Wilson v, Sep 10 2004
STATUS
approved