Skip to main content

A number is divisible by 3 iff sum of its digits are divisible by 3

I was walking with my girlfriend other day, and I started telling her how Indian mathematics education is quite different and taught quite differently. One example I gave her was that they teaches you that a natural number is divisible by 3 if and only if the sum of its digits (in decimal representation) are also divisible by 3. Then I asked, "do you know why?" without knowing the answer. So both of us started thinking of ways to prove it. After a moment of thoughts, I came up with the proof idea for one direction: if the sum of digits of a natural number is divisible by 3, then the number is divisible by 3. Let’s formally prove this.

Proof that if the sum of digits of a natural number in decimal representation is divisible by 3 then the number is also divisible by 3 #

Let n be a natural number with the decimal representation akak1a1a0 where k is a non-negative integer and 0ik,0ai9. Suppose the sum of digits is divisible by 3, which is to say  (i=0kai)mod30

Then n=i=0kai10i. Because 10mod31, it follows that iZ+,10imod31 by properties of modular arithmetic. Thus ai10imod3(aimod3)(10imod3)mod3aimod3. Hence nmod3(i=0kai10i)mod3(i=0kai)mod3. By the supposition, (i=0kai)mod30, and therefore nmod3=0 as desired. Q.E.D.

The proof for the other direction, however, quite troubled me to come up with. By supposing that the number is divisible by 3 doesn’t really give you any information about each digit. But this direction can be proved easily using the technique of proof by contradiction.

Proof that if a natural number is divisible by 3, then the sum of its digits in decimal representation is also divisible by 3 #

Suppose not. Suppose there exists a natural number n that is divisible by 3 and the sum of its digits in decimal representation is not divisible by 3. That is to say if akak1a1a0 is the decimal representation of n, then (i=0kai)mod30. It follows immediately that ni=0kai10i. But nmod3=(i=0kai)mod3 using the same argument made for the previous proof (this result is derived without using the divisibility of the sum of digits in the previous proof). By supposition, (i=0kai)mod30 so nmod30. Thus n is both divisible and not divisible by 3, which is a contradiction. Thus our supposition must be false and there is no natural number divisible by 3 and the sum of its digits in decimal representation is not divisible by 3, proving the statement. Q.E.D.