# Proving that $9$ is a divisor of $x \in \Bbb N$ if the sum of digits of $x$ is divisible by $9$. [duplicate]

Suppose x is a positive integer with $n$ digits, say $x = d_1d_2d_3\ldots d_n.$ If $9$ is a divisor of $d_1 + d_2 + \ldots d_n$, prove then $9$ is a divisor of $x$.

My attempt: suppose $x = 4518.$ Therefore $d_1 = 4, d_2 = 5, d_3 = 1, d_4 = 8$ those added together equals $18$, where $9$ is a divisor.

With that in mind $4518$ can be written as $4000 + 500 + 10 + 8.$ How do you show that $9$ is a divisor of this entire number from the information given?

## marked as duplicate by Jyrki LahtonenSep 7 '17 at 11:53

• Hint: $10=1+9$, $100=1+99$, and $1000=1+999$. Do you spot a pattern? Can you always rewrite $10^n$ as $1$ plus some appropriate multiple of $9$? – JMoravitz Sep 7 '17 at 3:16
• I think my method is easier than the other prove because many of students don't know congruency but everyone can understand my solution – Sufaid Saleel Sep 7 '17 at 3:26
• $$\forall x \in \mathbb{N}\lor\mathbb{Z}, \ 3n\mid x \iff \sum_{i \in d(x)} = 3k : (k,n) \in \mathbb{N}\lor\mathbb{Z} \ \land \ d(x) = \text{number of digits of x}$$ – George N. Missailidis Sep 7 '17 at 5:25

Since, $10\equiv 1 (\mod 9)\implies 10^k\equiv 1 (\mod 9).$ Now $x=d_1d_2\ldots d_n=10^nd_1+\ldots +10 d_2+d_1.$ So, $$x=\sum_{i=0}^n10^id_{i+1}\equiv \sum_{i=0}^nd_{i+1} (10^i \mod 9)=\sum_{i=0}^nd_{i+1}.$$ So, $x$ is divisible by $9$ if and only if $\sum_{i=0}^nd_{i+1}$ is divisible by $9$.
• Your indices are not consistent: in your first expansion of x, $d_1$ is the first digit, but then it's both the first and the last one, and then in the summation $d_1$ is the digit that goes with $10^0$, that is, the last one. – Fabio Turati Sep 7 '17 at 7:16
$x=10^nd_1+10^{n-1}d_2+... + 10^0 d_n$. Which implies $$x= [9999\overbrace{...}^{\large\text{(n-1)times}} \times d_1+9999\overbrace{...}^{\large\text{(n-2)times}} \times d_2+... +9\times d_{n-1} ]+[d_1+d_2+d_3+... + d_n]$$. Here the first part is divisible by 9. Also you told me that the second part is also divisible by 9. Hence $x$ is divisible by 9. QED.
• I don't know. $~~~$ – A---B Sep 9 '17 at 13:00