# Proof required

• August 1st 2007, 11:17 PM
c0unsel
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
• August 2nd 2007, 07:21 AM
ThePerfectHacker
Not only is the number divisible by 3 its divisible by 9!

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

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

Thus,
$n-m = 10^n(A_1-B_1)+10^{n-1}(A_2-B_2)+...+(A_N-B_N)$ $\equiv (A_1-B_1)+(A_2-B_2)+...+(A_N-B_N)(\bmod 9)$
Since $10\equiv 1(\bmod 9)\implies 10^k \equiv 1(\bmod 9)$.
But,
$(A_1-B_1)+...(A_N-B_N)=(A_1+...+A_N)-(B_1+...+B_N)=0$.
Q.E.D.
• August 2nd 2007, 09:39 AM
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
• August 2nd 2007, 10:22 AM
ThePerfectHacker
Quote:

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?
• August 2nd 2007, 11:24 AM
c0unsel
Unfortunately not. However, in the event that the same proves too complex to explain a suitable link would be gratefully digested.
• August 2nd 2007, 11:28 AM
ThePerfectHacker
Maybe this is a little too advanced.