Digit Sum and Divisibility by 9 and 3 Explained with Worked Examples

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.

Write 2x or 2*x to multiply, ^ for powers, and ; between simultaneous equations. You can also type factor, expand, derivative of, integrate … from a to b, limit … as x->0 or 15% of 80.

Try an example

Before you start

This page is easier if you are comfortable with:

What Digit sum and divisibility by 9 and 3 means

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.

What is it used for?

The digit sum rule gives a quick test for divisibility by 3 and 9, and a way to check arithmetic.

How to use digit sum and divisibility by 9 and 3

  1. Add up the digits of the number.
  2. If the sum is a multiple of 9, the number is a multiple of 9; if a multiple of 3, the number is a multiple of 3.
  3. To find the remainder, take the digit sum mod 9.
  4. For a missing digit, set the total equal to the nearest suitable multiple of 9.

Graph

4723 and its digit sum 16 leave the same remainder 7 on division by 94723 mod 9 = 716 mod 9 = 700.511.522.53024684723 and its digit sum 16 leave the same remainder 7 on division by 9xyGraph with x from 0 to 3 and y from 0 to 9. Shows bars (2); point 4723 mod 9 = 7 at (1, 7); point 16 mod 9 = 7 at (2, 7).

Both bars have height 7, so the digit sum and the number agree modulo 9.

Worked examples

These examples are worked by hand, step by step, so you can compare your own working.

Example 1: remainder mod 9

Find the remainder when 4723 is divided by 9.

Worked example
Answer
77
  1. Digit sum
  2. Repeat

Example 2: is it divisible?

Is 7281 divisible by 9?

Worked example
Answer
yes: 7281=9×809\text{yes: }7281=9\times809
  1. Digit sum
  2. 18 is a multiple of 9, so yes

Example 3: missing digit

Find the digit so that is divisible by 9.

Worked example Answer checked
Answer
d=4d=4
  1. Digit sum
  2. Multiple of 9
  3. Check

Special cases

A few situations come up again and again. Knowing them saves time and helps you spot answers that cannot be right.

4729

digit sum 22

4729 ≡ 4 (mod 9).

7623

digit sum 18

Divisible by 9: 847.

1234 mod 3

digit sum 10

Remainder 1.

Digit sum of 4729

4 + 7 + 2 + 9

22.

Word problems

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.

Digit sum

4729.

  1. 4 + 7 + 2 + 9
  2. Check: ✓22

Remainder

4729 mod 9.

  1. 22 mod 9
  2. Check: 4 ✓4

Divisible Higher

7623 ÷ 9.

  1. digit sum 18
  2. Check: 847 ✓847

Mod 3 Higher

1234 mod 3.

  1. 10 mod 3
  2. Check: ✓1

Common mistakes

Divisibility by 6 from digit sum

enough ✗

also needs even ✓

Both 2 and 3.

Digit sum divisible by 3 means divisible by 9

wrong ✗

only 3 | N ✓

Check 9.

Forgetting repeated summing

single step ✗

repeat until one digit ✓

Digital root.

Applying to 11 or 7

same rule ✗

different rules ✓

Rule for 9 and 3 only.

Exam tips

  1. N ≡ digit sum (mod 9).
  2. Divisible by 9: digit sum divisible by 9.
  3. Divisible by 3: digit sum divisible by 3.
  4. Digital root.
  5. Check by dividing.

Practice questions

Try each one on paper, then open the answer. Use the solver above to see the full working.

1. Digit sum of 98765 Foundation

35

2. 5832 mod 9 Foundation

0

3. 1001 mod 3 Foundation

2

4. Digit sum of 2023 Higher

7

5. 999 mod 9 Higher

0

6. 123456 mod 9 Higher

3

Practice generator

Unlimited fresh questions with instant marking. Choose a level, work it out on paper, then type your answer.

Solve: …

Key terms

Digit sum
S(N).
Digital root
Repeated digit sum.
Congruence
Same remainder.
Place value
10ᵏ.
Divisibility rule
Test.
Casting out nines
Error check.

Frequently asked questions

What is the divisibility rule for 9?

N is divisible by 9 iff its digit sum is.

What about 3?

Same with 3.

Why does it work?

10 ≡ 1 (mod 9), so 10ᵏ ≡ 1.

What is N mod 9?

The digit sum mod 9.

Which page covers the rule for 11?

divisibility rule for 11.

Which page covers Legendre’s formula?

Legendre’s formula.

More in Discrete maths and number theory and the formula sheets.