Divisibility rules for 3 and 9
Overview
Divisibility by 3
A number is divisible by iff the sum of its digits is divisible by .
Divisibility by 9
A number is divisible by iff the sum of its digits is divisible by .
[!IMPORTANT] A base-10 integer has the same remainder mod and mod as its digit sum.
Why the digit-sum rule works: and
Write a positive integer in base 10:
Modulo 3: We have , so for every . Therefore:
So and the digit sum leave the same remainder when divided by . In particular:
- iff .
Modulo 9: Similarly , so . Hence:
So iff .
Example
- has digit sum . So , hence divisible by (and by ).