# Sum of the digits

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

Quote:

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

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

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

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

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

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

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

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

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