Originally posted by joe shmo
Has anyone noticed the sum of the digits of multiples of 3 repeat 3,6,9 up until 39 which its sum is 12, which has a sum of 3 restarting the sequense replacing a sum of 12 fo three. can anyone explain this?
Yup, it's a way to check if a number is a multiple of three;
Have a number abc (where a, b and c stand for the single digits of a three-digit number).
You can write it as a * 100 + b * 10 + c * 1
a * 99 is a multiple of 3, as well as b * 9.
So abc is a multiple of three
if and only if
a * 1 + b * 1 + c * 1 = a + b + c is a multiple of three.
This works for all numbers.
So to check if 123456723 is a multiple of three, we calculate 1+2+3+4+5+6+7+2+3 = 33.
To check if 33 is a multiple of three, we calculate 3+3 = 6
6 is a multiple of 3, so 123456723 is a multiple of three as well.
You have a similar trick for multiples of 9 (sum of digits must be 9 then) and multiples of 11 (alternating sum of digits must be 0).
There is even one for multiples of 7, but that's a bit trickier.