Motivation
My friends invited me to lunch at the Google office today (very fortunate for a man who’s fending on his own). While eating, we somehow ended up debating the supposed superiority of the dragon over the hare in the Chinese zodiac. As a loyal hare, I came to the defense of hares everywhere by claiming that 1999 is a far more interesting number than the boring 2000. For whatever reason, this led me to ask whether 1999 is divisible by 3. It felt like it should be. (Of course it isn’t—1999 is prime and the concatenation of three 9s, a number which is the square of another great prime. What a fantastic number!)
Two friends at the table immediately said no, and I was impressed by how quickly they answered. When I asked how they knew, they replied, “Didn’t you ever learn the trick where you sum the digits and check whether that sum is divisible by 3?” I hadn’t. To test it, I tried 201: , and indeed it’s divisible by 3. Same with 2001. The rule seemed to work, but when I asked why—warum muss das sein?—no one at the table had an answer.
We must roll up our sleeves so as to determine why is must be.
Proof
We will show that a number is divisible by 3 if and only if the sum of its digits is divisible by 3. We begin with the two-digit case and then generalize. (We ignore the one-digit case because it is trivial.)
Two-Digit Number
Let a two-digit number be written as in base-10, meaning
Let
Assume that is divisible by 3, so for some integer . Then we may rewrite
Substituting into the expression for , we obtain
Both terms on the right-hand side are divisible by 3: by assumption, and . Therefore,
which shows that is divisible by 3.
Thus, for a two-digit number, divisibility by 3 is equivalent to the divisibility by 3 of the sum of its digits.
The General Case
Now consider an -digit number written as
which represents the integer
Let the sum of its digits be
Assume that is divisible by 3, so for some integer .
We separate the term in the expression for :
From the definition of , we have
Substituting this into the expression for yields
For each , we may write
which is a multiple of 9 and therefore a multiple of 3. Hence, each term is divisible by 3, and so is their sum.
Since is also divisible by 3, it follows that , another notation to say “3 divides ”. This completes the proof for the general case.
Conclusion
I am now rather satisfied with this answer, and it will be a technique I use to quickly check divisibility by 3. Naturally, I am now curious what other similar shortcuts exist, besides the obvious divisibility by 2 or 5 where we need only check the last digit.