4729
digit sum 22
4729 ≡ 4 (mod 9).
A number leaves the same remainder as its digit sum when divided by 9 (and by 3): . So a number is divisible by 9 exactly when its digit sum is, and by 3 exactly when its digit sum is.
This page is easier if you are comfortable with:
The reason is that , so every power of 10 leaves remainder 1. A number such as therefore leaves the same remainder as . This is a simple use of modular arithmetic, closely related to the rule for 11, where .
The rule can be repeated: add the digits of the digit sum until one digit remains (the digital root). It is used to check arithmetic, because a wrong sum, product or difference often changes the remainder mod 9, a method known as casting out nines. It also helps with prime factor form and in finding the HCF and LCM.
Missing-digit puzzles use the rule: choose the digit that makes the digit sum a multiple of 9 or 3. For related results on squares see squares modulo 4 and 8, and for the proof style used here see proof by induction and the sum of two squares theorem.
The digit sum rule gives a quick test for divisibility by 3 and 9, and a way to check arithmetic.
Both bars have height 7, so the digit sum and the number agree modulo 9.
These examples are worked by hand, step by step, so you can compare your own working.
Find the remainder when 4723 is divided by 9.
Is 7281 divisible by 9?
Find the digit so that is divisible by 9.
A few situations come up again and again. Knowing them saves time and helps you spot answers that cannot be right.
digit sum 22
4729 ≡ 4 (mod 9).
digit sum 18
Divisible by 9: 847.
digit sum 10
Remainder 1.
4 + 7 + 2 + 9
22.
N ≡ S(N) (mod 9) and (mod 3), because 10 ≡ 1 (mod 9). So N is divisible by 9 (or 3) exactly when its digit sum is.
4729.
4729 mod 9.
7623 ÷ 9.
1234 mod 3.
enough ✗
also needs even ✓
Both 2 and 3.
wrong ✗
only 3 | N ✓
Check 9.
single step ✗
repeat until one digit ✓
Digital root.
same rule ✗
different rules ✓
Rule for 9 and 3 only.
Try each one on paper, then open the answer. Use the solver above to see the full working.
35
0
2
7
0
3
Unlimited fresh questions with instant marking. Choose a level, work it out on paper, then type your answer.
Solve: …
N is divisible by 9 iff its digit sum is.
Same with 3.
10 ≡ 1 (mod 9), so 10ᵏ ≡ 1.
The digit sum mod 9.
divisibility rule for 11.
More in Discrete maths and number theory and the formula sheets.