Divisibility Rules for 2 to 12 and Testing for Prime Numbers
Checking Divisibility Without Dividing
Is 7,452 divisible by 9? Is 1,001 a prime number? You can answer questions like these in seconds, without long division, by using divisibility rules. These shortcuts are useful for simplifying fractions, finding HCF and LCM, factorising numbers and checking answers, and they come up directly in WAEC, NECO and JAMB questions. This tutorial covers the divisibility rules for 2 to 12, explains why the main ones work, and then uses them to test for prime numbers, count factors and solve typical exam problems.
Divisibility Rules for 2 to 12
- 2: the last digit is even (0, 2, 4, 6 or 8). 3,578 is divisible by 2.
- 3: the sum of the digits is divisible by 3. For 4,317: 4 + 3 + 1 + 7 = 15, which is divisible by 3, so 4,317 is too.
- 4: the number formed by the last two digits is divisible by 4. For 7,316 the last two digits are 16, so yes.
- 5: the last digit is 0 or 5.
- 6: divisible by both 2 and 3. 846 is even and 8 + 4 + 6 = 18, so it is divisible by 6.
- 7: double the last digit and subtract it from the rest of the number; repeat until the result is small. For 672: 67 − 2 × 2 = 63 = 9 × 7, so 672 is divisible by 7.
- 8: the number formed by the last three digits is divisible by 8. For 15,128: 128 = 16 × 8, so yes.
- 9: the sum of the digits is divisible by 9. For 7,452: 7 + 4 + 5 + 2 = 18, so 7,452 is divisible by 9.
- 10: the last digit is 0.
- 11: the alternating sum of the digits (add and subtract them in turn from the right) is divisible by 11, including 0. For 9,152: 2 − 5 + 1 − 9 = −11, so 9,152 is divisible by 11.
- 12: divisible by both 3 and 4.
Rules for composite numbers combine rules for factors that share no common factor: 6 = 2 × 3, 12 = 3 × 4, 15 = 3 × 5 and 18 = 2 × 9. Be careful: 12 is not "2 and 6", because 2 and 6 share a factor; 18 is divisible by 2 and 6 but not by 12.
Why the Divisibility Rules Work
Understanding the reasons makes the divisibility rules easy to remember.
The rules for 2, 4, 8, 5 and 10. 10 is divisible by 2 and 5, so every multiple of 10 is too. A number like 3,578 is 3,570 + 8; the 3,570 part is always divisible by 2, so only the last digit matters. Similarly 100 is divisible by 4 and 1,000 by 8, which is why we only check the last two or three digits.
The rules for 3 and 9. Every power of ten is one more than a multiple of 9: 10 = 9 + 1, 100 = 99 + 1, 1,000 = 999 + 1. So
4,317 = 4 × 1000 + 3 × 100 + 1 × 10 + 7 = (4 × 999 + 3 × 99 + 1 × 9) + (4 + 3 + 1 + 7).
The first bracket is a multiple of 9 (and therefore of 3), so 4,317 leaves the same remainder as its digit sum, 15. Since 15 is divisible by 3 but not 9, 4,317 is divisible by 3 but not by 9.
The rule for 11. Powers of ten alternate: 10 = 11 − 1, 100 = 99 + 1, 1,000 = 1,001 − 1, and 99 and 1,001 are multiples of 11. So the digits count with alternating signs.
Prime Numbers and Composite Numbers
A prime number has exactly two factors: 1 and itself. The primes below 50 are 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43 and 47.
- 1 is not prime, because it has only one factor.
- 2 is the only even prime; every other even number is divisible by 2.
- A number with more than two factors, such as 12, is composite.
Every whole number greater than 1 can be written as a product of primes in exactly one way (apart from order). This is the Fundamental Theorem of Arithmetic, and it is why prime factorisation works for finding HCF and LCM.
Testing Whether a Number Is Prime
To test whether n is prime, you only need to try dividing by the primes up to √n. If n = a × b with both factors bigger than √n, then a × b would be bigger than n, which is impossible. So any factor pair must include one number no bigger than √n.
Example 1. Is 143 prime?
√143 is just under 12, so test 2, 3, 5, 7 and 11. 143 is odd; its digit sum is 8 (not divisible by 3); it doesn't end in 0 or 5; 14 − 2 × 3 = 8 is not divisible by 7; and for 11: 3 − 4 + 1 = 0, so 143 is divisible by 11. 143 = 11 × 13, so it is not prime.
Example 2. Is 211 prime?
√211 is about 14.5, so test 2, 3, 5, 7, 11 and 13. 211 is odd; digit sum 4; doesn't end in 0 or 5; 21 − 2 = 19 is not a multiple of 7; 1 − 1 + 2 = 2 is not a multiple of 11; and 13 × 16 = 208, leaving remainder 3. None divide it, so 211 is prime.
Example 3. Is 1,001 prime?
The rule for 11: 1 − 0 + 0 − 1 = 0, so 11 divides it. In fact 1,001 = 7 × 11 × 13, a useful number to remember.
The Sieve of Eratosthenes
To list all the primes up to a limit, write the numbers from 2 upwards. Circle 2 and cross out all its other multiples. Circle the next number not crossed out (3) and cross out its multiples. Continue with 5, 7, and so on. You can stop once you reach √(limit); every number still standing is prime. For primes up to 100 you only need to sieve with 2, 3, 5 and 7, which leaves 25 primes.
Counting the Factors of a Number
Prime factorisation also tells you how many factors a number has. If n = 2ᵃ × 3ᵇ × 5ᶜ × …, the number of factors is (a + 1)(b + 1)(c + 1)…
Example 4. How many factors does 360 have?
360 = 2³ × 3² × 5. The number of factors is (3 + 1)(2 + 1)(1 + 1) = 4 × 3 × 2 = 24. Each factor is formed by choosing a power of 2 (0 to 3: four choices), a power of 3 (0 to 2: three choices) and a power of 5 (0 or 1: two choices).
Example 5. Find the smallest number that must multiply 72 to give a perfect square.
72 = 2³ × 3². A perfect square needs every prime to an even power. The power of 2 is odd, so multiply by 2: 72 × 2 = 144 = 12². The answer is 2.
Exam-Style Problems Using Divisibility Rules
Example 6. Find the digit d if the five-digit number 4 7 d 3 2 is divisible by 9.
The digit sum is 4 + 7 + d + 3 + 2 = 16 + d. The next multiple of 9 is 18, so d = 2 (d = 11 is not a digit). The number is 47,232, and 47,232 ÷ 9 = 5,248.
Example 7. Which of 2,346, 5,215 and 7,128 are divisible by 6?
- 2,346: even, digit sum 15 (divisible by 3), so yes.
- 5,215: odd, so no.
- 7,128: even, digit sum 18, so yes.
Example 8. Simplify 252/378 quickly.
Both digit sums are 9 and 18, so both are divisible by 9: 252/378 = 28/42. Both are divisible by 14: 28/42 = 2/3.
Summary
- Last digits test for 2, 5 and 10; the last two digits for 4; the last three for 8.
- Digit sums test for 3 and 9; alternating digit sums test for 11.
- Combine rules for factors with no common factor: 6 = 2 × 3, 12 = 3 × 4.
- To test whether n is prime, try only the primes up to √n.
- If n = 2ᵃ × 3ᵇ × 5ᶜ…, it has (a + 1)(b + 1)(c + 1)… factors.