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 A061903 #18 Oct 27 2023 22:00:46 %S A061903 1,1,4,1,3,3,1,2,2,1,1,4,1,2,2,1,2,3,1,2,4,1,2,2,2,2,3,2,3,2,1,2,3,2, %T A061903 2,2,2,3,2,1,3,2,2,3,3,1,2,2,1,3,3,1,2,3,2,2,2,2,2,2,1,2,3,3,3,2,2,3, %U A061903 2,2,2,2,2,3,3,2,3,3,2,2,2,2,3,3,2,2,3,3,3,3,1,3,3,3,3,2,2,3,3,2,1,4,1,2,2 %N A061903 Number of distinct elements of the iterative cycle: n -> sum of digits of n^2. %C A061903 It seems that any such iterative cycle can contain at most 4 distinct elements. %C A061903 a(197483417) = 5 is the first counterexample: 136 -> 28 -> 19 -> 10 -> 1. In fact this sequence is unbounded, since you can extend any chain leftward with the number k999...999 for suitably chosen k. In particular this gives the (pessimistic) bound that there is some n < 10^21942602 with a(n) = 6. - _Charles R Greathouse IV_, May 30 2014 %H A061903 Robert Israel, <a href="/A061903/b061903.txt">Table of n, a(n) for n = 0..10000</a> %e A061903 a(2) = 4 since 2 -> 4 -> 1+6 = 7 -> 4+9 = 13 -> 1+6+9 = 16 -> 2+5+6 = 13, thus {4,7,13,16} are the distinct elements of the iterative cycle of 2. a(6) = 1 since 6 -> 3+6 = 9 -> 8+1 = 9 thus 9 is the only element in the iterative cycle of 6. %p A061903 A:= proc(n) local L,m,x; %p A061903 L:= {}; x:= n; %p A061903 do %p A061903 x:= convert(convert(x^2,base,10),`+`); %p A061903 if member(x,L) then return nops(L) fi; %p A061903 L:= L union {x}; %p A061903 od: %p A061903 end proc: %p A061903 seq(A(n), n=0..200); # _Robert Israel_, May 30 2014 %o A061903 (PARI) a(n)=my(v=List()); while(1, n=sumdigits(n^2); for(i=1, #v, if(n==v[i], return(#v))); listput(v,n)) \\ _Charles R Greathouse IV_, May 30 2014 %Y A061903 Cf. A007953, A004159, A061904-A061910. %K A061903 nonn,base,easy %O A061903 0,3 %A A061903 _Asher Auel_, May 17 2001 %E A061903 Corrected a(0) and example, _Robert Israel_, May 30 2014