Let $n$ be a three digit number. Prove or give a counter example: $9|n$ if and only if the digits of $n$ sum to a multiple of $9$.
I was able to go from left to right. But I'm having a hard time going from right to left. Thanks.
Let $n$ be a three digit number. Prove or give a counter example: $9|n$ if and only if the digits of $n$ sum to a multiple of $9$.
I was able to go from left to right. But I'm having a hard time going from right to left. Thanks.
On
It is true in general.
Let $$ n=a_0+10^1a_1+\dots+10^k a_k. $$ Then $$ n-(a_0+a_1+\dots+a_k)= 9a_1+99a_2+\dots+99...9a_k, $$ which is divisible by 9. This end the proof.
On
Let $n=100a+10b+c$ and $m=a+b+c$. Since
$$n-m=99a+9b$$ that is a multiple of $9$, $m$ is a multiple of $9$ if and only if $n$ is.
On
Here is another way of writing out much the same thing in the general case.
First define $E_n=1+10+\dots +10^{n-1}$. Define $E_0=0$ and then $E_{n+1}=10E_n+1$ which could also act as a recursive definition. Note that we have $E_1=1$.
Now $9E_0=10^0-1$, and if $9E_n=10^n-1$ we have $$9E_{n+1}=90E_n+9=10(10^n-1)+9=10^{n+1}-1$$ and this gives us $10^n=9E_n+1$ for $n\ge 0$.
Then $$\sum a_n10^n=9\sum a_nE_n +\sum a_n$$
Let $n = 100a + 10b + c$. Consider this mod $9$: $$ n \equiv 100a + 10b + c \equiv a + b + c \pmod 9 $$ Since $9 \mid n$ iff $n \equiv 0 \pmod 9$ iff $a + b + c \equiv 0 \pmod 9$ iff "the digits sum to a multiple of $9$", we're done in both directions.