OFFSET
2,3
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 2..10000
MathOverflow, Does iterating a certain function related to the sums of divisors eventually always result in a prime value?, 2014
Hugo Pfoertner, Terms a(2)...a(1000000).
MATHEMATICA
f[n_] := Plus @@ Divisors@n - 1; g[n_] := Length@ NestWhileList[ f@# &, n, !PrimeQ@# &] - 1; Table[ g@n, {n, 2, 106}] (* Robert G. Wilson v, May 07 2010 *)
PROG
(PARI) a(n)=my(t); while(!isprime(n), n=sigma(n)-1; t++); t \\ Charles R Greathouse IV, Sep 16 2014
CROSSREFS
KEYWORD
nonn
AUTHOR
EXTENSIONS
Escape clause added by N. J. A. Sloane, Aug 31 2017
STATUS
approved