# Sum of the digits

• Apr 7th 2008, 01:39 AM
james_bond
Sum of the digits
Prove that $S(\overline{9\ldots 9})=S(\overline{9\ldots 9}^2)$ (the number of 9s are the same); $S(n)$ is the sum of the digits of the number $n$.
• Apr 7th 2008, 03:50 AM
Soroban
Hello, James!

Quote:

Prove that $S(\overline{99\hdots 9})\:=\:S(\overline{99\hdots 9}^2)$ . . . the number of 9s is the same.

$S(N)$ is the sum of the digits of the number $N$.

$\text{Let }\,N \,=\,\underbrace{999\hdots 9}_{n\text{ digits}}$

. . Then: . $\boxed{S(N) \,=\,9n}$

Since $N \:=\:10^n-1$, then: . $N^2\;=\;(10^n-1)^2 \;=\;10^{2n} - 2\!\cdot\!10^n + 1$

. . That is: . $N^2\:=\:10^n(10^n-2) + 1$

This is the number $(10^n-2)$ "moved" $n$ places to the left, plus a 1.

$\text{The number }10^n-2\text{ has the form: }\:\underbrace{999\hdots98}_{n\text{ digits}}$
. . It contains $n-1$ 9's and an 8.

Therefore: . $S(N^2) \:=\:(n-1)9 + 8 + 1\quad\Rightarrow\quad\boxed{ S(N^2) \;=\;9n}$