The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A004159 Sum of digits of n^2. 67

%I #64 Nov 12 2021 12:23:37

%S 0,1,4,9,7,7,9,13,10,9,1,4,9,16,16,9,13,19,9,10,4,9,16,16,18,13,19,18,

%T 19,13,9,16,7,18,13,10,18,19,13,9,7,16,18,22,19,9,10,13,9,7,7,9,13,19,

%U 18,10,13,18,16,16,9,13,19,27,19,13,18,25,16,18,13,10,18,19,22,18,25,25,18,13

%N Sum of digits of n^2.

%C If 3|n then 9|a(n); otherwise, a(n) == 1 (mod 3). - _Jon E. Schoenfield_, Jun 30 2018

%H Zak Seidov, <a href="/A004159/b004159.txt">Table of n, a(n) for n = 0..10000</a>

%H A. S. Besicovitch, <a href="http://dx.doi.org/10.1007/BF01201350">The asymptotic distribution of the numerals in the decimal representation of the squares of the natural numbers</a>, Mathematische Zeitschrift 39 (1934), pp. 146-156.

%H H. Davenport and P. Erdős, <a href="http://cms.math.ca/10.4153/CJM-1952-005-3">Note on normal decimals</a>, Canadian Journal of Mathematics 4 (1952), pp. 58-63.

%H Michael Drmota, Christian Mauduit and Joël Rivat, <a href="http://www.dmg.tuwien.ac.at/drmota/dmr6.pdf">The sum-of-digits function of polynomial sequences</a>, J. Lond. Math. Soc. (2) 84(2011), no. 1, 81--102. MR2819691 (2012f:11193)

%H Bernt Lindström, <a href="http://dx.doi.org/10.1006/jnth.1997.2129">On the binary digits of a power</a>, Journal of Number Theory, Volume 65, Issue 2, August 1997, Pages 321-324.

%H Christian Mauduit and Joël Rivat, <a href="http://dx.doi.org/10.1007/s11511-009-0040-0">La somme des chiffres des carrés</a>, Acta Mathem. 203 (1) (2009) 107-148. MR2545827 (2010j:11119).

%H H. I. Okagbue, M. O. Adamu, S. A. Iyase and A. A. Opanuga, <a href="http://www.indjst.org/index.php/indjst/article/view/69912">Sequence of Integers Generated by Summing the Digits of their Squares</a>, Indian Journal of Science and Technology, Vol 8(15), DOI: 10.17485/ijst/2015/v8i15/69912, July 2015.

%H K. B. Stolarsky, <a href="http://dx.doi.org/10.1090/S0002-9939-1978-0495823-5">The binary digits of a power</a>, Proc. Amer. Math. Soc. 71 (1978), 1-5.

%F a(n) = A007953(A000290(n)); a(A058369(n)) = A007953(A058369(n)). - _Reinhard Zumkeller_, Apr 25 2009

%F a(10n) = a(n). If n > 1 is not a multiple of 10, then a(n)=4 iff n = 10^k+1 = A062397(k), a(n)=7 iff n is in A215614={4, 5, 32, 49, 149, 1049}, and else a(n) >= 9. - _M. F. Hasler_, Sep 23 2014

%e Trajectories under the map x -> a(x):

%e 1 -> 1 -> 1 -> 1 -> 1 -> 1 -> 1 -> 1 -> 1 -> ...

%e 2 -> 4 -> 7 -> 13 -> 16 -> 13 -> 16 -> 13 -> 16 -> ...

%e 3 -> 9 -> 9 -> 9 -> 9 -> 9 -> 9 -> 9 -> 9 -> ...

%e 4 -> 7 -> 13 -> 16 -> 13 -> 16 -> 13 -> 16 -> 13 -> ...

%e 5 -> 7 -> 13 -> 16 -> 13 -> 16 -> 13 -> 16 -> 13 -> ...

%e 6 -> 9 -> 9 -> 9 -> 9 -> 9 -> 9 -> 9 -> 9 -> ...

%e 7 -> 13 -> 16 -> 13 -> 16 -> 13 -> 16 -> 13 -> 16 -> ...

%e - _R. J. Mathar_, Jul 08 2012

%p read("transforms"):

%p A004159 := proc(n)

%p digsum(n^2) ;

%p end proc: # _R. J. Mathar_, Jul 08 2012

%t a004159[n_Integer] := Apply[Plus, IntegerDigits[n^2]]; Table[

%t a004159[n], {n, 0, 100}] (* _Michael De Vlieger_, Jul 21 2014 *)

%t Total[IntegerDigits[#]]&/@(Range[0,100]^2) (* _Harvey P. Dale_, Feb 03 2019 *)

%o (Haskell)

%o a004159 = a007953 . a000290 -- _Reinhard Zumkeller_, Apr 12 2014

%o (Python)

%o def A004159(n):

%o return sum(int(d) for d in str(n*n)) # _Chai Wah Wu_, Sep 03 2014

%o (PARI) A004159(n)=sumdigits(n^2) \\ _M. F. Hasler_, Sep 23 2014

%Y Cf. A007953, A159918, A056691, A268226.

%Y Cf. A240752 (first differences), A071317 (partial sums).

%Y Cf. A062685 (smallest square with digit sum n, or 0 if no such square exists).

%K nonn,base

%O 0,3

%A _N. J. A. Sloane_

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 21 00:01 EDT 2024. Contains 372720 sequences. (Running on oeis4.)