I've been wondering ever since I learned about the divisibility of nine trick. Add up the sum of the digits. If the sum is a multiple of nine, the entire number is divisible by nine. If the sum is too big to tell, repeat with the sum.
It's amazing. But my question is: why does this work? Does it have something to do with the fact that 10 - 9 = 1?

- 806
- 7
- 21
-
1https://math.stackexchange.com/questions/328562/divisibility-criteria-for-7-11-13-17-19 – lab bhattacharjee Jan 19 '20 at 14:26
-
Thanks, @lab bhatttacharjee. The link is helpful. – Mathemagician314 Jan 19 '20 at 18:49
4 Answers
Yes, it is precisely because $10-9=1$.
If you have a number with digits $abc$, we can write that as $100a+10b+c$. Now, $$\begin{align} 100a+10b+c &= (99+1)a+(9+1)b+c\\ &= (99a+9b) + a+b+c \end{align}$$
Observe that $99a+9b$ is a multiple of $9$, so the entire number will be a multiple of $9$ only if the remaining part, $a+b+c$, is also a multiple of $9$. This principle extends to any number of digits.
Using similar reasoning, a number is divisible by $3$ if and only if the sum of its digits is also divisible by $3$. This is because $10$ is $1$ greater than a multiple of $3$.

- 24,627
Consider a number in the form $\overline{abcd}$. clearly this can be written as :
$$1000a+100b+10c+d=9\left(111a+11b+1c\right)+\left(a+b+c+d\right)$$
Then this number is divisible by $9$ if $$ 9\left(111a+11b+1c\right)+\left(a+b+c+d\right)≡0\tag{mod 9}$$
in other words the sum $a+b+c+d$ should be divisible by $9$.
It comes from congruences modulo $9$. As $10\equiv 1\mod 9$, any $10^k\equiv 1\mod 9$ and you have e.g. for the number $N=45\,386\:$ (in base $10$), by definition of the positional notation: $$N=4\cdot10^4+5\cdot10^3+3\cdot10^2+8\cdot10+6\equiv 4+5+3+8+6\equiv 8\mod 9$$ so the remainder when you divide $N$ by $9$ is $8$.
You have an analogous test for divisibility by $11$, based on the fact that $10\equiv -1\bmod 11$, so that $10^k\equiv (-1)^k\bmod 11$. For the same number you have $$N\equiv 6-8+3-5+4=0\mod 11,$$ so $N$ is divisible by $11$ (indeed the quotient is $4126$).
There also exist similar criteria for divisibility by $13$ and $37$, based on the facts that $10^3\equiv -1\bmod 13$, $\equiv 1 \bmod 37$.

- 175,478
How about starting with another trick?
We are using decimal notation and have our digit symbols
$\tag 1 \mathcal D = \{0,1,2,3,4,5,6,7,8,9\}$
and a base $T = 9 + 1$ and a $\text{base-}T$ representation for integers.
Let $n$ be an integer satisfying $10 \le n \le 99$ satisfying
$\tag 2 n = a_1 a_0 = a_1 T + a_0 \quad \text{ where } a_1, a_2 \in \mathcal D \text{ and } a_1 \ne 0 \text{ and } a_0 \ne 9$.
Trick 1: To subtract $9$ from $n$ let $b_1 = a_1 - 1$ and $b_0 = a_0 + 1$ and then you can write
$\tag 3 n - 9 = a_1 a_0 - 9 = b_1 b_0$
We are now going to show that the OP's trick is valid using trick 1.
Let $m$ be a (positive) integer with $\text{base-}T$ representation
$\tag 4 m = a_k a_{k-1} \dots a_1 a_0$
Lemma 1: If $m \ge 18$ satisfies
$\tag 5 9 \text{ divides } a_k + a_{k-1} + \dots + a_1 + a_0$
then $9$ divides $m$.
Proof
To get a contradiction assume that $9$ does not divides $m$ and take $m$ to be the minimal positive integer where this happens. If $a_{k-1} = 9$ then replacing it with $0$,
$\quad m' = m - 9 \times T^{k-1} = a_k 0 a_{k-2} \dots a_1 a_0$
constructs a number $m'$ smaller than $m$ satifying $\text{(5)}$ which is not divisible by $9$. So $a_{k-1}$ can't be equal to $9$.
Now using an extended variation of Trick 1, if we write $b_k = a_k - 1$ and $b_{k-1} = a_{k-1} + 1$, then
$\quad m' = m - 9 \times T^{k-1} = b_k b_{k-1} a_{k-2} \dots a_1 a_0$
also leads to a contradiction. $\quad \blacksquare$
By adapting the proof of lemma 1 you can verify
Lemma 2: If $m \ge 18$ is divisible by $9$ then $\text{(5)}$ is true.
The truth of the OP's divisibility by $9$ trick has been demonstrated.

- 11,366