# Greetings from The On-Line Encyclopedia of Integer Sequences! http://oeis.org/
Search: id:a003132
Showing 1-1 of 1
%I A003132 M3355 #85 Nov 05 2023 08:44:47
%S A003132 0,1,4,9,16,25,36,49,64,81,1,2,5,10,17,26,37,50,65,82,4,5,8,13,20,29,
%T A003132 40,53,68,85,9,10,13,18,25,34,45,58,73,90,16,17,20,25,32,41,52,65,80,
%U A003132 97,25,26,29,34,41,50,61,74,89,106,36,37,40,45,52,61,72,85,100,117,49
%N A003132 Sum of squares of digits of n.
%C A003132 It is easy to show that a(n) < 81*(log_10(n)+1). - _Stefan Steinerberger_, Mar 25 2006
%C A003132 It is known that a(0)=0 and a(1)=1 are the only fixed points of this map. For more information about iterations of this map, see A007770, A099645 and A000216 ff. - _M. F. Hasler_, May 24 2009
%D A003132 N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
%D A003132 Hugo Steinhaus, One Hundred Problems in Elementary Mathematics, Dover New York, 1979, republication of English translation of Sto Zadań, Basic Books, New York, 1964. Chapter I.2, An interesting property of numbers, pp. 11-12 (available on Google Books).
%H A003132 T. D. Noe, Table of n, a(n) for n = 0..10000
%H A003132 J.-P. Allouche and J. Shallit, The ring of k-regular sequences, II, Theoret. Computer Sci., 307 (2003), 3-29; [preprint from author's web page, PostScript format].
%H A003132 Arthur Porges, A set of eight numbers, Amer. Math. Monthly 52 (1945), 379-382.
%H A003132 B. M. Stewart, Sums of functions of digits, Canad. J. Math., 12 (1960), 374-389.
%H A003132 Robert Walker, Self Similar Sloth Canon Number Sequences
%H A003132 Index entries for Colombian or self numbers and related sequences
%F A003132 a(n) = n^2 - 20*n*floor(n/10) + 81*(Sum_{k>0} floor(n/10^k)^2) + 20*Sum_{k>0} floor(n/10^k)*(floor(n/10^k) - floor(n/10^(k+1))). - _Hieronymus Fischer_, Jun 17 2007
%F A003132 a(10n+k) = a(n)+k^2, 0 <= k < 10. - _Hieronymus Fischer_, Jun 17 2007
%F A003132 a(n) = A007953(A048377(n)) - A007953(n). - _Reinhard Zumkeller_, Jul 10 2011
%p A003132 A003132 := proc(n) local d; add(d^2,d=convert(n,base,10)) ; end proc: # _R. J. Mathar_, Oct 16 2010
%t A003132 Table[Sum[DigitCount[n][[i]]*i^2, {i, 1, 9}], {n, 0, 40}] (* _Stefan Steinerberger_, Mar 25 2006 *)
%t A003132 Total/@(IntegerDigits[Range[0,80]]^2) (* _Harvey P. Dale_, Jun 20 2011 *)
%o A003132 (PARI) A003132(n)=norml2(digits(n)) \\ _M. F. Hasler_, May 24 2009, updated Apr 12 2015
%o A003132 (Haskell)
%o A003132 a003132 0 = 0
%o A003132 a003132 x = d ^ 2 + a003132 x' where (x', d) = divMod x 10
%o A003132 -- _Reinhard Zumkeller_, May 10 2015, Aug 07 2012, Jul 10 2011
%o A003132 (Magma) [0] cat [&+[d^2: d in Intseq(n)]: n in [1..80]]; // _Bruno Berselli_, Feb 01 2013
%o A003132 (Python)
%o A003132 def A003132(n): return sum(int(d)**2 for d in str(n)) # _Chai Wah Wu_, Apr 02 2021
%Y A003132 Cf. A052034, A052035.
%Y A003132 Cf. A007953, A055017, A076313, A076314.
%Y A003132 Concerning iterations of this map, see A003621, A039943, A099645, A031176, A007770, A000216 (starting with 2), A000218 (starting with 3), A080709 (starting with 4, this is the only nontrivial limit cycle), 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
%Y A003132 Cf. A080151, A051885 (record values and where they occur).
%Y A003132 Cf. A257588, A332919.
%K A003132 nonn,easy,look,base,nice
%O A003132 0,3
%A A003132 _N. J. A. Sloane_
%E A003132 More terms from _Stefan Steinerberger_, Mar 25 2006
%E A003132 Terms checked using the given PARI code, _M. F. Hasler_, May 24 2009
%E A003132 Replaced the Maple program with a version which works also for arguments with >2 digits, _R. J. Mathar_, Oct 16 2010
%E A003132 Added ref to Porges. Steinhaus also treated iterations of this function in his Polish book Sto zadań, but I don't have access to it. - _Don Knuth_, Sep 07 2015
# Content is available under The OEIS End-User License Agreement: http://oeis.org/LICENSE