%I #39 Nov 19 2021 11:25:45
%S 0,1,4,9,16,25,36,49,64,81,1,4,9,16,25,36,49,64,81,100,4,9,16,25,36,
%T 49,64,81,100,121,9,16,25,36,49,64,81,100,121,144,16,25,36,49,64,81,
%U 100,121,144,169,25,36,49,64,81,100,121,144,169,196,36,49,64,81,100,121,144
%N Square of sum of decimal digits of n.
%C a(k) = k iff k = 0, 1, 81; also, the only solution to the double equation a(k) = m and a(m) = k with k < m is (169, 256) (proof in Diophante link, 2ème jonglerie). - _Bernard Schott_, Mar 08 2021
%H N. J. A. Sloane, <a href="/A118881/b118881.txt">Table of n, a(n) for n = 0..10000</a>
%H Diophante, <a href="http://www.diophante.fr/problemes-par-themes/arithmetique-et-algebre/a1-pot-pourri/123-a1915-jongleries-nd2-avec-les-chiffres">A1915, Jongleries n°2 avec les chiffres</a> (in French).
%H Michael Penn, <a href="https://www.youtube.com/watch?v=BiItd78ihEg">squaring the sum of digits</a>, YouTube video, 2021.
%F a(n) = A007953(n)^2. [_R. J. Mathar_, Apr 22 2010]
%e From _R. J. Mathar_, Jul 08 2012: (Start)
%e Trajectories of the map x->a(x), A177148:
%e 1 ->1 ->1 ->1 ->1 ->1 ->1 ->1 ->1 ->...
%e 2 ->4 ->16 ->49 ->169 ->256 ->169 ->256 ->169 ->...
%e 3 ->9 ->81 ->81 ->81 ->81 ->81 ->81 ->81 ->...
%e 4 ->16 ->49 ->169 ->256 ->169 ->256 ->169 ->256 ->...
%e 5 ->25 ->49 ->169 ->256 ->169 ->256 ->169 ->256 ->...
%e 6 ->36 ->81 ->81 ->81 ->81 ->81 ->81 ->81 ->...
%e 7 ->49 ->169 ->256 ->169 ->256 ->169 ->256 ->169 ->...
%e 8 ->64 ->100 ->1 ->1 ->1 ->1 ->1 ->1 ->... (End)
%p read("transforms") :
%p A118881 := proc(n)
%p digsum(n)^2 ;
%p end proc: # _R. J. Mathar_, Jul 08 2012
%t Table[Total[IntegerDigits[n]]^2,{n,0,70}] (* _Harvey P. Dale_, Jul 31 2012 *)
%o (PARI) a(n) = sumdigits(n)^2; \\ _Michel Marcus_, Mar 08 2021
%o (Python)
%o def a(n): return sum(map(int, str(n)))**2
%o print([a(n) for n in range(67)]) # _Michael S. Branicky_, Nov 19 2021
%Y Cf. A007953.
%K base,easy,nonn
%O 0,3
%A _Giovanni Teofilatto_, May 25 2006