1. ## Proof required

I have observed that if one takes a whole number, between 10 and 9999, then re-arranges the digits in any way. Then, one subtracts the lesser number from the greater, the answer is always divisible by three. Eg let 5124 be original number. Re-arranged to be 4512. 5124 - 4512 = 612, which is divisible by three.

Is there a proof as to why this is so?

Many thanks if anyone can help

c0unsel

2. Not only is the number divisible by 3 its divisible by 9!

Say $\displaystyle n=A_1A_2...A_N$ be a number. And let $\displaystyle m=B_1B_2...B_N$ be a permutation of its digits.

Then, $\displaystyle n=10^nA_1+10^{n-1}A_{n-1}+...+A_N$ and $\displaystyle m=10^nB_1+10^{n-1}B_2+...+B_N$

Thus,
$\displaystyle n-m = 10^n(A_1-B_1)+10^{n-1}(A_2-B_2)+...+(A_N-B_N)$$\displaystyle \equiv (A_1-B_1)+(A_2-B_2)+...+(A_N-B_N)(\bmod 9)$
Since $\displaystyle 10\equiv 1(\bmod 9)\implies 10^k \equiv 1(\bmod 9)$.
But,
$\displaystyle (A_1-B_1)+...(A_N-B_N)=(A_1+...+A_N)-(B_1+...+B_N)=0$.
Q.E.D.

3. Thankyou for the proof which i confess, is too complicated for me to follow. Is there any prospects of breaking down the steps further. If not, thankyou anyway and i will try and decipher.

c0unsel

4. Originally Posted by c0unsel
Thankyou for the proof which i confess, is too complicated for me to follow. Is there any prospects of breaking down the steps further. If not, thankyou anyway and i will try and decipher.

c0unsel
Are you familar with the basic laws of modular arithmetic?

5. Unfortunately not. However, in the event that the same proves too complex to explain a suitable link would be gratefully digested.

6. Maybe this is a little too advanced.