Show that $n-m$ is a multiple of 9 when $n$ and $m$ have same digits

424 Views Asked by At

I have just proved the divisibility rule for 3 and 9.

Let $n\in\mathbb{N}$. Let $m$ be a number that appears when you shuffle the digits in $n$. Show that $n-m$ is a multiple of 9.

Can anyone offer some help?

3

There are 3 best solutions below

2
On BEST ANSWER

The digit sum $s$ of $n$ and $m$ is the same. Since we have $n \equiv s\pmod 9$ and $m \equiv s\pmod 9$ we get $$n-m \equiv s-s \equiv 0 \pmod 9,$$ so $9\mid n-m$ .

0
On

We have $$10\equiv 1 \pmod9.$$ By induction we have $$10^n\equiv 1 \pmod9$$ for any $n\in\mathbb N\cup\{0\}$.

Using this you should be able to show $$10^k\equiv10^l\pmod9$$ for any $k,l\in\mathbb N\cup\{0\}$.

Can you get $$a\cdot10^2+b\cdot10+c \equiv b\cdot10^2+c\cdot10+a \pmod 9$$ from this? Can you generalize this to an arbitrary permutation?

0
On

I don't want to get drowned in notation. So let's just look at three digit numbers and you can figure out the general case.

The most general three digit number would be $n = (d_3 d_2 d_1)_{10} = 100d_3 + 10d_2 + d_1$. Let's let $S(n) = d_1+d_2+d_3$ denote the digit sum of $N$.

Now \begin{align} n - S(n) &= (100d_3 + 10d_2 + d_1) - (d_1+d_2+d_3)\\ &= (100d_3 - d_3) + (10d_2 - d_2) + (d_1 - d_1)\\ &= 99d_3 + 9d_2\\ &= 9(11d_3 + d_2) \end{align}

So 9 divides n - S(n)

Hence 9 divides (m - S(m)) - (n - S(n)) = (S(n) - S(m)) + (m - n)$.

If $m$ is just $n$ with the digits shuffled, then $S(m) - S(n) = 0$.

In which case 9 divides $n - m$.