Difference Between Permutations Divisible by 9?

857 Views Asked by At

Given a permutation, for example:

1234 1243 . . 4321

Can anybody explain why the differences between numbers are always (no proof, but for all simple permutations) divisible by 9?

2

There are 2 best solutions below

5
On BEST ANSWER

The difference between two numbers of that type is the sum of terms like this:

\begin{equation} x(10^p-10^q) \end{equation}

where $x$ is one of the digits (1,2,3 or 4). If $p>q$ you can write: \begin{equation} 10^p-10^q=10^q(10^{p-q}-1) \end{equation}

the term between brackets is a power of 10 minus 1, so it is divisible by 9. If $p<q$ is analogous to $p>q$ and for $p=q$ we have $10^p-10^q=0$ (divisible by 9).

0
On

The digit sum $S()$ of a number $x$, $S(x) \equiv x \bmod 9$.

Therefore every digit permutation $\pi()$ of a number has the same residue $\bmod 9$. This means that the difference between them has zero residue $\bmod 9$:

$x-\pi(x) \equiv S(x) - S(x) \equiv 0 \bmod 9$

And thus the difference is divisble by $9$.