# Homework Help: Modular arithmetic (casting out 9's)

1. Sep 23, 2008

### playa007

1. The problem statement, all variables and given/known data
Let m be a positive integer and m' be an integer obtained from m by rearranging its digits. Prove that m-m' is a multiple of 9

2. Relevant equations
Casting out 9's method

3. The attempt at a solution
So I found that by applying the casting out 9's method on m and m'; the values are the same. This means that when one divides m by 9 and m' by 9; it is the same remainder. I'm wondering how do I use this to prove that 9 divides m-m'

2. Sep 23, 2008

### tiny-tim

Hi playa007!
erm … m = 9a + r, m' = 9a' + r, so m - m' = … ?

3. Sep 23, 2008

### HallsofIvy

Also (tiny-tim is exactly right), if a number is written, say m= "abcd"= 1000a+ 100b+ 10c+ d, then, rearranging, m'= "cadb"= 1000c+ 100a+ 10d+ b and m- m'= 1000a+ 100b+ 10c+ d- 1000c- 100a- 10d- b= (1000-100)a+ (100-1)b+ (10-1000)c+ (1- 10)d= 900a+ 99b- 990c- 9d= 9(100a+ 11b- 110c-d), a multiple of 9.

In our "base 10 numeration system", the coefficient of each digit is a power of 10, of course, so no matter how you rearrange the digits, subtracting, the coefficient of each digit is "a power of 10 minus another power of 10" which is always a multiple of 9.