system
Given the following post, respond as if you're commenting on Reddit:
human
Why do multiples of 9, always come back to 9 when their digits are added together?

Sorry I could have probably worded the title better.

I remember my second grade teacher taught me this but never explained why she just said it was a a magic number lol.

Example:

9*2=18,  1+8=9

9*3=27,  2+7=9

9*4=36,  3+6=9

etc, etc, etc.....,

Of course there are many interesting recurrences with small number and wen we learned our multiplication tables as kids,  but this trend seems to stay the same even as the number you multiply by 9 increase.  Even with random numbers in the tens and hundreds similar pattern.

Example

9*53=477,  4+7+7=18,   1+8=9

9*87=783,  7+8+3=18,   1+8=9

9*681=6129, 6+1+2+9=18,   1+8=9

9*217=1953, 1+9+5+3=18,   1+8=9


Now I've only used  positive integers,  haven't even looked into negatives, nor decimals, nor any other parameters so to speak.  Are there any exceptions doing this with positive integers? And why does this work?  This is a smart sub and I'm sure the answer is simple but I've just always been curious about it.  I'll try a few more larger random  numbers with greater number of digits.



9*876,257=7,886,313 : 

7+8+8+6+3+1+3=36,    3+6=9

One more even larger number


9*12,345,678=111,111,102   :

1+1+1+1+1+1+1+0+2=9


Are there any other weird happenstances like this?  if so please elaborate...
gpt
To see why this works, we first have to start with how a number, when written down, is constructed.

Take the number 123. This notation means: 1 * 100 + 2 * 10 + 3 * 1. To deconstruct a number in this way, you take a digit and multiply it by the power of 10 appropriate for the position of that digit within the number.

Now we make a brief detour through the realms of divisibility and remainders. Note that we only work with integers, so no decimals or funny stuff behind the period. When we divide something like 52 / 9, we can fit 9 a total of 5 times and are left with a remainder of 7. So we can write:

52 / 9 = 5

but also

52 % 9 = 7

The %-sign is often used for the function that gives you the remainder in a certain division. This function is called the modulo function. If a number fully divides another number, the remainder will be zero:

18 % 9 = 0 (this says: The remainder when dividing 18 by 9 is 0)

Now, the modulo function has some nice properties. One of which is that it is distributive with addition and multiplication. What does this mean? It means that if we have an expression like (a + b) % c (or: the remainder of (a + b) when divided by c), then that's the same as a % c + b % c (or: the remainder of a when divided by c plus the remainder of b when divided by c). The same holds when you replace the addition-operation by multiplicaiton.

Now, lets put the pieces together. First we look at the remainder of a few numbers when divided by 9:

1 % 9 = 1

10 % 9 = 1 (10 divided by 9 is 1 with remainder 1)

100 % 9 = 1 (100 divided by 9 is 11 with remainder 1)

1000 % 9 = 1 (1000 divided by 9 is 111 with remainder 1)

Notice a pattern?

If we have a number of the form abcd, then from the first section we know that this can be written as:

a * 1000 + b * 100 + c * 10 + d * 1

So if we want to see what the remainder of this number is when divided by 9, we can use the properties of the modulo function:

abcd % 9 = (a * 1000 + b * 100 + c * 10 + d * 1) % 9 = (a * 1000) % 9 + (b * 100) % 9 + (c * 10) % 9 + (d * 1) % 9

Each term can be rewritten as:

(a % 9) * (1000 % 9)

Since we know that a power of 10 has remainder 1 when divided by 9, these factors drop out and we're left with:

(a % 9) + (b % 9) + (c % 9) + (d % 9)

Once again applying the distributivity of the modulo function:

(a + b + c + d) % 9

So the final conclusion is that the remainder of a number when divided by 9 is equal to the remainder of the sum of the digits of the number when divided by 9. More specifically, if a number is fully divisible by 9 (so remainder 0), then the sum of its digits is too.

In some cases, the sum of the digits will be a number consisting of multiple digits. In that case, you can reapply the same reasoning to the sum of the digits of the sum of the digits. And repeat this process until you end up with a one digit number that is divisible by 9. And which one digit numbers are divisible by 9? Just one, 9 itself.

So a general conclusion is that if a number is divisble by 9, then the repeated summing of its digits in this way will always end up with a 9. And, to check if a number is divisible by 9, you can add up its digits and check if that value is divisible by 9. If that value is still to big to quickly check, you can repeat the process.

Note: There is a similar property when dividing by 3: A number is divisible by 3 if and only if the sum of its digits are divisible by 3. The proof of this statement follows the same reasoning as for division by 9.

Finally, homework for the interested reader: There's a similar, but slightly more involved trick to determine whether a number is divisible by 11. Find it and prove it :-)