# 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 Wolfram 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

$100a+10b+c=(99a+a)+(9b+b)+c=(99a+9b)+(a+b+c)=9(11a+b)+9k=9(11a+b+k)$.
• 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