system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: Is there an underlying mathematical reason behind why, if the sum of a number's digits is divisible by 3, that number is also divisible by 3?

Howdy, y'all! :)

So, I love mathematics, I think it's a fascinating, beautiful subject; and one of the first things I remember being fascinated with in it is this rule, that you can check if a number is evenly divisible by 3 by adding up its digits, and checking to see if that sum is evenly divisible by 3. (For instance: 2379, 2+3+7+9=21, 21/3=7; quick division confirms that 2379/3=793, so the rule holds true here.)

I've spent years fascinated by this, and 3 has ended up being my favorite number as a result - I even memorized its powers to a stupidly-high degree, for fun - but I only ever recently thought to ask the question, "Why does that work, exactly?" As far as I know, this test doesn't work for any other numbers (for example: the digits of 52 add up to 7, a number which is not divisible by either 2 or 4, and yet both those numbers evenly divide into 52); so, what exactly is so special about 3, to make it consistently, always work this way?
gpt
Say you have a three-digit number, and its digits are a, b, c. (e.g. for 783 a=7,b=8,c=3)

So you can write the number as 100\*a+10\*b+c.   (700+80+3)

This is the same as 99\*a + a + 9\*b + b + c

Obviously 99a and 9b are both divisible by 3.

Which, in order for there not to be a remainder, requires a+b+c be divisible by 3 - i.e. the sum of the digits to be divisible by 3 - for the number to be divisible by 3.

You can see how you can extrapolate this to any number of digits.