# Sum of digits iterated

Original version. I believe that it is an elementary question, already discussed somewhere. But I just have no idea of how to start it properly. Take a positive integer $n=n_1$ and compute its sum of digits $n_2=S(n)=S_{10}(n)$ in the decimal system. If the newer number $n_2$ is greater than $10$, then compute the sum $n_3=S(n_2)$ of its digits, and continue this iteration $n_k=S(n_{k-1})$ unless you get a number $n^* =n_\infty$ in the range $1\le n^* \le 9$. Is $n^*$ uniformly distributed in the set $\lbrace 1,2,\dots,9\rbrace$? If this is not true in the decimal systems, what can be said in the other systems?

I just learned yesterday about the Feng shui system of determining what kind of problems/advantages one can get according to the house number, say $n$, of his/her home. This depends on the above $n^*$. I do not seriously count on the conclusions but I am curious whether $n^*$ is sufficiently democratic.

Edit. The question was immediately realized as obvious, because $n^*$ is the residue modulo $9$ (with 0 replaced by 9), and this works in any base as well. So the Feng shui function is really trivial, but one can deal with less trivial ones.

Let me fix $m$ and define $Q_m(n)$ as the sum of $m$th powers of decimal digits of a positive integer $n$. What can be said about the sequence of iterations $n_k=Q_m(n_{k-1})$ for a given integer $n_0$? How long can the (minimal) period be for a fixed $m$? And what can be said about the distribution of the purely periodic tails?

I hope that the question is still elementary.

• I've always wanted to respond to a question by saying this: I don't know. And it's true. – Will Jagy Jun 4 '10 at 4:56

The case $m=2$ appears in Hugo Steinhaus's "One Hundred Problems In Elementary Mathematics", problem 2(at least in Russian edition of 1986). Either sequence will come to 1 and stay here, or will enter to the cycle (145,42,20,4,16,37,58,89)

• Thanks, Nurdin! The last time I read the book (in Russian, of course) was at least 25 years ago, but I am back to it after your hint. The things are really surprising to me... – Wadim Zudilin Jun 4 '10 at 6:47
• If they end in 1, they are called "Happy Numbers". Check Wikipedia. Their distribution up to 10**7000 can be found here: <shaunspiller.com/happynumbers> – Stefan Gruenwald Jun 28 '14 at 7:00

A starting place might be http://www.oeis.org/A005188 which lists $n$-digit numbers $r$ with $Q_n(r)=r$, and has references to related oddities.

• Oh-oh, I did not expect that there was research in this direction... These are narcissistic numbers (en.wikipedia.org/wiki/Armstrong_number): In "A Mathematician's Apology", G. H. Hardy wrote: "There are just four numbes, after unity, which are the sums of the cubes of their digits: $$153 = 1^3 + 5^3 + 3^3, \quad 370 = 3^3 + 7^3 + 0^3, \quad 371 = 3^3 + 7^3 + 1^3, \quad 407 = 4^3 + 0^3 + 7^3.$$ These are odd facts, very suitable for puzzle columns and likely to amuse amateurs, but there is nothing in them which appeals to the mathematician." I probably have to count myself an amateur. – Wadim Zudilin Jun 4 '10 at 6:45