OFFSET
1,4
COMMENTS
Records are found at indices given by A007497.
The above would be correct for a(1) = 0 (in a weak sense) or rather a(1) = -1 (for infinity), but as the sequence is defined, 2 & 3 do not produce a record, so the indices of records are 1, (3), 4, 7, ... = {1} U A007497 \ {2, (3)}. - M. F. Hasler, Nov 20 2019
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
M. Alekseyev, PARI/GP Scripts for Miscellaneous Math Problems: invsigma.gp, Oct. 2005
EXAMPLE
a(4)=2 because 4=sigma(3), but also sigma(sigma(2)) with 2 iterations.
a(7)=3 because 7=sigma(4), but also sigma(sigma(3)), and sigma(sigma(sigma(2))), with 3 iterations.
MAPLE
N:= 100: # to get a(1)..a(N)
V:= Vector(N):
for n from 1 to N do
s:= numtheory:-sigma(n);
if s <= N then V[s]:= max(V[s], V[n]+1) fi
od:
convert(V, list); # Robert Israel, May 01 2017
PROG
(PARI) a(n) = {if (n==1, return(1)); vn = vector(n-1, k, k+1); nb = 0; knb = 0; ok = 1; while(ok, nb++; vn = vector(#vn, k, sigma(vn[k])); svn = Set(vn); if (#select(x->x==n, svn), knb = nb); if (!#select(x->x<=n, svn), ok = 0); ); knb; }
(PARI) apply( A286011(n)=if(n<3, 2-n, n=invsigma(n), vecmax(apply(self, n))+1), [1..99]) \\ See Alekseyev-link for invsigma(). - M. F. Hasler, Nov 20 2019
CROSSREFS
KEYWORD
nonn
AUTHOR
Michel Marcus, Apr 30 2017
STATUS
approved