cp's OEIS Frontend

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.

A118881 Square of sum of decimal digits of n.

This page as a plain text file.
%I A118881 #43 Mar 17 2025 00:20:16
%S A118881 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 A118881 49,64,81,100,121,9,16,25,36,49,64,81,100,121,144,16,25,36,49,64,81,
%U A118881 100,121,144,169,25,36,49,64,81,100,121,144,169,196,36,49,64,81,100,121,144
%N A118881 Square of sum of decimal digits of n.
%C A118881 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
%C A118881 If the map i->a(i) is iterated starting at i = n, the trajectory will eventually reach one ot the three cycles (1) (if n == +-1 mod 9), (169,256) (if n == 2,4,5,7 mod 9), or (81) (if n == 0 mod 3). - _N. J. A. Sloane_, Mar 17 2025
%H A118881 N. J. A. Sloane, <a href="/A118881/b118881.txt">Table of n, a(n) for n = 0..10000</a>
%H A118881 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 A118881 Michael Penn, <a href="https://www.youtube.com/watch?v=BiItd78ihEg">Squaring the sum of digits</a>, YouTube video, 2021.
%F A118881 a(n) = A007953(n)^2. [_R. J. Mathar_, Apr 22 2010]
%e A118881 From _R. J. Mathar_, Jul 08 2012: (Start)
%e A118881 Trajectories of the map x->a(x), A177148:
%e A118881 1 ->1 ->1 ->1 ->1 ->1 ->1 ->1 ->1 ->...
%e A118881 2 ->4 ->16 ->49 ->169 ->256 ->169 ->256 ->169 ->...
%e A118881 3 ->9 ->81 ->81 ->81 ->81 ->81 ->81 ->81 ->...
%e A118881 4 ->16 ->49 ->169 ->256 ->169 ->256 ->169 ->256 ->...
%e A118881 5 ->25 ->49 ->169 ->256 ->169 ->256 ->169 ->256 ->...
%e A118881 6 ->36 ->81 ->81 ->81 ->81 ->81 ->81 ->81 ->...
%e A118881 7 ->49 ->169 ->256 ->169 ->256 ->169 ->256 ->169 ->...
%e A118881 8 ->64 ->100 ->1 ->1 ->1 ->1 ->1 ->1 ->... (End)
%p A118881 read("transforms") :
%p A118881 A118881 := proc(n)
%p A118881         digsum(n)^2 ;
%p A118881 end proc: # _R. J. Mathar_, Jul 08 2012
%t A118881 Table[Total[IntegerDigits[n]]^2,{n,0,70}] (* _Harvey P. Dale_, Jul 31 2012 *)
%o A118881 (PARI) a(n) = sumdigits(n)^2; \\ _Michel Marcus_, Mar 08 2021
%o A118881 (Python)
%o A118881 def a(n): return sum(map(int, str(n)))**2
%o A118881 print([a(n) for n in range(67)]) # _Michael S. Branicky_, Nov 19 2021
%Y A118881 Cf. A007953.
%K A118881 base,easy,nonn
%O A118881 0,3
%A A118881 _Giovanni Teofilatto_, May 25 2006