If you have a number n, then the result of n % 9
(that's the remainder when you divide n by 9) is called
the residue.
The residue of 11 is 2. The residue of 97 is 7.
The residue of 999 is 0.
A multiple of 9 always has a residue
of 0.
It's a magical fact that
if you add up the digits of a number, the sum always has the same
residue as the original number.
(I was going to explain it later, but tilly already
did that so you can read it there if you like.)
Every number must have the same residue as its reverse.
Why? Because each number has the same residue as
the sum of its own digits, and you get the same sum
whether you add the digits forwards
or backwards. Let's try an example.
What's the residue of 125? The residue is the remainder
after we divide by 9. 125/9 is 13 with a remainder of 8, so the
residue of 125 is 8. What's the residue of 521?
521/9 is 57, also with a remainder of 8. And the digit
sum of each number is also 8.
Now imagine adding two numbers with residues of 1 and 2.
Imagine each number is a heap of beans. If you
split up the first heap into smaller
piles of 9 beans each, you will have 1 bean left over.
If you split up the second heap similarly, you have 2 beans
left over. When you combine the two heaps, you get
many little piles of 9 beans, but the beans that were left over
before are sitll left over, and there are 3 of them in all.
These 3 beans are the residue of the sum of the two original numbers..
Whenever you add two numbers, the residue of the
sum is the sum of the residues of the original numbers.
The opposite is true for subtraction. If two numbers
each have the same residue, say 5,
then they each have 5 beans left over
after you divide them into piles of 9.
If you subtract them, the extra 5's cancel out and you are left with
a multiple of 9, which has a residue of 0.
We saw before that every number has the same residue as
its reverse.
That means that if you subtract a number from its reverse
you get a number with a residue of 0, which means that
the difference must be a multiple of 9.
I hope that explains everything except the magic fact
that I left out.
|