# Don't understand casting out nines

Let n be a positive integer. If the sum of the digits of n is divisible by 9, then n is divisible by 9.

I got upto here,

100a + 10b + c = n
a + b + c = 9k; k exists in the set Z (all integers)


I didn't know what to do after this, so I consulted the solution

The next step is:

100a + 10b + c = n = 9k + 99a + 9b = 9(k + 11a + b):


I don't get how you can add 99a + 9b randomly, can someone please explain this for me

-

## migrated from mathematica.stackexchange.comMar 1 '13 at 6:44

This question came from our site for users of Mathematica.

You're asking in the wrong place. You're probably looking for Mathematics SE which is different from Mathematica SE – RunnyKine Mar 1 '13 at 5:55
Ok, but I dont know how to delete this – Gangstar Mar 1 '13 at 6:44

## 1 Answer

$100a+10b+c=(99a+a)+(9b+b)+c=(99a+9b)+(a+b+c)=9(11a+b)+9k=9(11a+b+k)$.

Addendum. Two points.

1. First, this isn't exactly what is usually referred to as "casting out nines", which is detailed on the linked Wikipedia page. This is just a method for checking that a number divides by 9.

2. Since I did it for you, you should consider trying a similar method to figure out how the sum of the digits of a number can tell you if it divides by 3. How can you tell if a number divides by 6?

-
About your first addendum: you cannot deny that there's a relation though. Casting out nines is a simple checksum by taking mod 9 all the summands and the sum and using the fact that $[(a \mod 9) + (b \mod 9)] \mod 9 = (a+b) \mod 9$. – Willie Wong Mar 1 '13 at 8:31