I was once in an accounting class, and the teacher said that the difference of a number, say N, and the same number with a transposition error, N', is usually divisible by 9. I never really gave it too much thought until last Friday's class when we were discussing credit card numbers and all that. Anyways I wanted to see if this is always the case, and if I could prove it.

First, I let $N=a_{n}a_{n-1}...a_{m}a_{k}...a_{2}a_{1}a_{0}.$ where each $a_{i}$ represents a digit between 0 and 9. Then I wrote it as a sum of increasing powers of 10,

(1)Next, we will transcribe $a_{m}$ and $a_{k}$ in our number $N$ and let this equal $N'$. Then we consider their difference, $N-N'$. We see that all the digits which were not transcribed cancel out, leaving

(2)Thus $9|N-N'$ for all transcription errors which swap adjacent digits.

Then, I began to wonder what happens if you swap more than 1 digit at a time , or 1 digit for 3 digits, and so on. I created similar proofs and was finding that 9 divided the difference each time. Finally, I came up with a theorem:

**Theorem:** For any number N, if you scramble the digits up in any order and let the new number equal N', then 9 divides there difference.

I started thinking about how to prove this, and thought my previous proof was a good start, however too difficult to make it apply to this case. I looked around on the internet a bit and found if you consider the difference of $N$ and $N \mod 9$, it will always be divisible by 9, which will prove helpful.

So the proof is as follows:

**Proof:**

Let N be as before. Then $N \equiv a_{n}+a_{n-1} + ... + a_{2} + a_{1} + a_{0} \mod 9$. Let $S=a_{n}+a_{n-1} + ... + a_{2} + a_{1} + a_{0}$. Then,

(4)Note that $10^{k}-1$ is equivalent to a number with k digits equal to 9, which is equivalent to 9 multiplied by a number with k digits all equal to 1. So clearly each term in $N-S$ is divisible by 9, which means $9|N-S$.

Now things are starting to come together, because if we let N' be our scrambled version of N, we still have $N' \equiv S \mod 9$. And if you looked back to N-S we see that the actual digits didn't contribute to each term being divisible by 9, just the $10^{k}-1$ part of each term did. So even though we jumbled up the digits, we still have $9|N'-S$. Enter integral linear combos and were done. So Since $9|N-S$ and $9|N'-S$, then 9 divides any integral linear combination of $N-S$ and $N'-S$, this includes the combo $(N-S) - (N'-S) = N - N'$, so $9|N - N'$ and we are done.

As an actual tool for checking transposition, I don't think it is practical because you must know what the number should actually be ahead of time. But it is neat to see that $9|N - N'$ in any case.