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 A000218 #47 Sep 08 2022 08:44:27 %S A000218 3,9,81,65,61,37,58,89,145,42,20,4,16,37,58,89,145,42,20,4,16,37,58, %T A000218 89,145,42,20,4,16,37,58,89,145,42,20,4,16,37,58,89,145,42,20,4,16,37, %U A000218 58,89,145,42,20,4,16,37,58,89,145,42,20,4,16,37,58,89,145,42,20,4,16,37 %N A000218 Take sum of squares of digits of previous term; start with 3. %C A000218 Could also have offset 0, considered as the orbit of 3 under A003132, i.e., n-fold application of A003132 on the initial value 3. - _M. F. Hasler_, Apr 27 2018 %D A000218 R. Honsberger, Ingenuity in Math., Random House, 1970, p. 83. %H A000218 Vincenzo Librandi, <a href="/A000218/b000218.txt">Table of n, a(n) for n = 1..100</a> %H A000218 Arthur Porges, <a href="http://www.jstor.org/stable/2304639">A set of eight numbers</a>, Amer. Math. Monthly 52 (1945), 379-382. %H A000218 A. Porges, <a href="/A003621/a003621.pdf">A set of eight numbers</a>, Amer. Math. Monthly, 52 (1945), 379-382. [Annotated scanned copy] %H A000218 <a href="/index/Rec#order_08">Index entries for linear recurrences with constant coefficients</a>, signature (0, 0, 0, 0, 0, 0, 0, 1). %F A000218 Eventually periodic with period 8. %t A000218 NestList[Total[IntegerDigits[#]^2]&, 3, 80] (* _Vincenzo Librandi_, Jan 29 2013 *) %o A000218 (PARI) A000218(n)=[89, 145, 42, 20, 4, 16, 37, 58, 3, 9, 81, 65, 61][n%8+8^(n<6)] \\ _M. F. Hasler_, May 24 2009, edited Apr 27 2018 %o A000218 (Haskell) %o A000218 a000218 n = a000218_list !! (n-1) %o A000218 a000218_list = iterate a003132 3 %o A000218 -- _Reinhard Zumkeller_, Aug 24 2011 %o A000218 (Magma) [3, 9, 81, 65, 61] cat &cat[[37, 58, 89, 145, 42, 20, 4, 16]: n in [0..17]]; // _Vincenzo Librandi_, Jan 29 2013 %Y A000218 Cf. A003132 (the iterated map), A003621, A039943, A099645, A031176, A007770, A000216 (starting with 2), A080709 (starting with 4), A000221 (starting with 5), A008460 (starting with 6), A008462 (starting with 8), A008463 (starting with 9), A139566 (starting with 15), A122065 (starting with 74169). - _M. F. Hasler_, May 24 2009 %K A000218 nonn,base,easy %O A000218 1,1 %A A000218 _N. J. A. Sloane_