OFFSET
0,3
REFERENCES
N. Agronomof, Question 4419, L'Intermédiaire des Math. 21 (1914) 147.
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 0..10000
MATHEMATICA
s=0; Do[s=s+Apply[Plus, IntegerDigits[n^2]]; Print[s], {n, 1, 128}]
nxt[{n_, a_}]:={n+1, a+Total[IntegerDigits[(n+1)^2]]}; NestList[nxt, {0, 0}, 60][[All, 2]] (* Harvey P. Dale, Mar 09 2017 *)
FoldList[#1 + Total@ IntegerDigits[#2^2] &, 0, Range@ 55] (* Michael De Vlieger, Mar 25 2017 *)
Accumulate[Plus @@@ IntegerDigits[Range[0, 50]^2]] (* Giovanni Resta, Mar 25 2017 *)
PROG
(Haskell)
a071317 n = a071317_list !! n
a071317_list = scanl1 (+) a004159_list
-- Reinhard Zumkeller, Apr 12 2014
(Python)
from itertools import count, islice, accumulate
def A071317_gen(): # generator of terms
return accumulate(map(lambda n:sum(map(int, str(n**2))), count(0)))
CROSSREFS
KEYWORD
easy,nonn,base
AUTHOR
Labos Elemer, May 27 2002
EXTENSIONS
a(0) = 0 prepended by Reinhard Zumkeller, Apr 12 2014
STATUS
approved