OFFSET
1,2
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..1000
EXAMPLE
a(6) = 42 as a(5) = 24 giving a(6) = 24 + (sum of digits of 24^2 = 576) = 24 + 5 + 7 + 6 = 42. - David A. Corneth, Jun 26 2022
MATHEMATICA
NestList[#+Total[IntegerDigits[#^2]]&, 1, 50] (* Harvey P. Dale, Sep 21 2023 *)
PROG
(PARI) first(n) = {n=max(n, 1); my(res=vector(n)); res[1] = 1; for(i = 2, n, res[i] = res[i-1] + sumdigits(res[i-1]^2)); res} \\ David A. Corneth, Jun 26 2022
CROSSREFS
KEYWORD
nonn,base,easy,less
AUTHOR
Miklos SZABO (mike(AT)ludens.elte.hu)
STATUS
approved