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 A286011 #24 Dec 01 2019 06:01:42 %S A286011 1,0,1,2,0,1,3,4,0,0,0,2,1,2,5,0,0,1,0,1,0,0,0,6,0,0,0,3,0,1,1,2,0,0, %T A286011 0,1,0,1,2,1,0,2,0,1,0,0,0,1,0,0,0,0,0,1,0,4,1,0,0,7,0,1,3,0,0,0,0,1, %U A286011 0,0,0,2,0,1,0,0,0,1,0,2,0,0,0,2,0,0,0,0,0,2 %N A286011 a(1)=1, and for n>1, a(n) is the maximum number of iterations of sigma resulting in n, starting at some integer k; or 0 if n cannot be reached from any k. %C A286011 a(n)=0 for n in A007369 and a(n)>0 for n in A002191. %C A286011 Records are found at indices given by A007497. %C A286011 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 %H A286011 Robert Israel, <a href="/A286011/b286011.txt">Table of n, a(n) for n = 1..10000</a> %H A286011 M. Alekseyev, <a href="https://home.gwu.edu/~maxal/gpscripts/invphi.gp">PARI/GP Scripts for Miscellaneous Math Problems: invsigma.gp</a>, Oct. 2005 %e A286011 a(4)=2 because 4=sigma(3), but also sigma(sigma(2)) with 2 iterations. %e A286011 a(7)=3 because 7=sigma(4), but also sigma(sigma(3)), and sigma(sigma(sigma(2))), with 3 iterations. %p A286011 N:= 100: # to get a(1)..a(N) %p A286011 V:= Vector(N): %p A286011 for n from 1 to N do %p A286011 s:= numtheory:-sigma(n); %p A286011 if s <= N then V[s]:= max(V[s],V[n]+1) fi %p A286011 od: %p A286011 convert(V,list); # _Robert Israel_, May 01 2017 %o A286011 (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;} %o A286011 (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 %Y A286011 Cf. A000203, A002191, A007369, A007497, A257670. %K A286011 nonn %O A286011 1,4 %A A286011 _Michel Marcus_, Apr 30 2017