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