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 A139566 #41 Dec 12 2023 08:35:50 %S A139566 15,26,40,16,37,58,89,145,42,20,4,16,37,58,89,145,42,20,4,16,37,58,89, %T A139566 145,42,20,4,16,37,58,89,145,42,20,4,16,37,58,89,145,42,20,4,16,37,58, %U A139566 89,145,42,20,4,16,37,58,89,145,42,20,4,16,37,58,89,145,42,20,4,16,37 %N A139566 a(n) is the sum of squares of digits of a(n-1); a(1)=15. %H A139566 Colin Barker, <a href="/A139566/b139566.txt">Table of n, a(n) for n = 1..1000</a> %H A139566 <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 A139566 Eventually periodic with period 8. %F A139566 a(n) = A008463(n) for n > 4. - _M. F. Hasler_, May 24 2009 %F A139566 a(n) = a(n-8) for n > 11. - _Colin Barker_, Aug 24 2015 %F A139566 G.f.: x*(36*x^10 + 6*x^9 - 27*x^8 - 145*x^7 - 89*x^6 - 58*x^5 - 37*x^4 - 16*x^3 - 40*x^2 - 26*x - 15) / ((x-1)*(x+1)*(x^2+1)*(x^4+1)). - _Colin Barker_, Aug 24 2015 %t A139566 a = {15}; Do[AppendTo[a, Plus @@ (IntegerDigits[a[[ -1]]]^2)], {70}]; a (* _Stefan Steinerberger_, Jun 14 2008 *) %t A139566 NestList[Total[IntegerDigits[#]^2] &, 15, 70] (* or *) PadRight[ {15,26,40},70,{42,20,4,16,37,58,89,145}](* _Harvey P. Dale_, Jan 28 2013 *) %o A139566 From _M. F. Hasler_, May 24 2009: (Start) %o A139566 (PARI) /* to check the given terms */ %o A139566 a=[/* paste the terms here */]; a==vector(#a,n,k=if(n>1,A003132(k),15)) %o A139566 /* to check the following code, use: a==vector(99,n,A139566(n)) */ %o A139566 A139566(n)=[15,26,40,16,37,58,89,145,42,20,4][if(n>11,(n-4)%8+4,n)] \\ (End) %o A139566 (PARI) Vec(x*(36*x^10+6*x^9-27*x^8-145*x^7-89*x^6-58*x^5-37*x^4-16*x^3 -40*x^2-26*x-15)/((x-1)*(x+1)*(x^2+1)*(x^4+1)) + O(x^70)) \\ _Colin Barker_, Aug 24 2015 %Y A139566 Cf. A101926, A087965, A074411, A110998, A051861, A048222. %Y A139566 Cf. A003132 (the iterated map), A003621, A039943, A099645, A031176, A007770, A000216 (starting with 2), A000218 (starting with 3), A080709 (starting with 4), A000221 (starting with 5), A008460 (starting with 6), A008462 (starting with 8), A008463 (starting with 9), A122065 (starting with 74169). - _M. F. Hasler_, May 24 2009 %K A139566 base,nonn,easy %O A139566 1,1 %A A139566 Robert Gornall (rob(AT)khobbits.net), Jun 11 2008 %E A139566 More terms from _Stefan Steinerberger_, Jun 14 2008 %E A139566 Terms checked, using the given PARI code, by _M. F. Hasler_, May 24 2009 %E A139566 Minor edits and starting value added in name by _M. F. Hasler_, Apr 27 2018