Numbers and Arithmetic

Divisibility Rules and the Reasons They Work

Test any whole number for factors from 2 to 17 without long division, and see the short place-value arguments that prove each rule.

Key takeaways

  • The rules for 2, 4, 5, 8 and 10 look only at the final digits, because large enough powers of ten are divisible by these numbers.
  • The rules for 3 and 9 use the digit sum, because every power of ten leaves remainder 1 on division by 3 or 9.
  • The rule for 11 uses an alternating sum, because powers of ten alternate between remainders 1 and −1.
  • For a composite divisor such as 12, combine tests for factors that share no common divisor, here 3 and 4.
  • Rules for 7, 13 and 17 work by trimming off the last digit and adjusting what remains.

A divisibility rule is a shortcut that tells you whether one whole number divides another exactly, with no remainder. To test for 3, you add the digits. To test for 4, you look at the last two. Each rule trades a hard division for an easy one on a smaller number.

None of these rules is a coincidence. They all come from one question: what remainder does each power of ten leave when you divide it by your chosen number? Answer that, and you can build a rule yourself.

The one idea behind everything

We say that d divides n if n = d × k for some whole number k. A key fact is that if d divides two numbers, it divides their sum and difference. So you may throw away any part of a number that is clearly a multiple of d, and test what is left.

Because of place value, any number splits into pieces. For example, 5,736 = 5 × 1,000 + 7 × 100 + 3 × 10 + 6. Each rule is a clever way of discarding multiples of d from those pieces.

Throughout, the numbers are whole and nonnegative. Zero is divisible by every positive whole number, since 0 = d × 0.

Looking at the final digits

The number 10 is divisible by 2 and 5. So everything in a number except its units digit is a multiple of 10, and can be ignored when testing for 2, 5 or 10.

Likewise, 100 is divisible by 4 and 25, and 1,000 is divisible by 8 and 125.

Divisor Test this Example
2 last digit is even 5,736 ends in 6, so yes
5 last digit is 0 or 5 5,736 ends in 6, so no
10 last digit is 0 no
4 last two digits 36 = 4 × 9, so yes
8 last three digits 736 = 8 × 92, so yes
25 last two digits are 00, 25, 50 or 75 no

A pattern appears: for 2ᵏ, check the last k digits. The reason is that 10ᵏ = 2ᵏ × 5ᵏ.

Adding the digits for 3 and 9

Every power of ten is one more than a string of nines: 10 = 9 + 1, 100 = 99 + 1, 1,000 = 999 + 1. Apply that to 5,736.

5736 = 5×(999+1) + 7×(99+1) + 3×(9+1) + 6
     = (5×999 + 7×99 + 3×9) + (5 + 7 + 3 + 6)

The first bracket is a multiple of 9, and therefore of 3. So 5,736 and its digit sum, 21, leave the same remainder. Since 21 is divisible by 3 but not by 9, so is 5,736: it equals 3 × 1,912, and 9 does not go in evenly.

The digit sum gives you the actual remainder too, which is why it powers the arithmetic check called casting out nines.

Alternating sums for 11

Powers of ten behave differently with 11. Ten is one less than 11, one hundred is one more than 99, one thousand is one less than 1,001, and the pattern continues. So the remainders alternate: 1, −1, 1, −1.

Starting from the units digit, add and subtract in turn. If the result is divisible by 11 (including 0 or a negative multiple such as −11), so is the number.

91828:  8 − 2 + 8 − 1 + 9 = 22   → divisible (11 × 8348)
5736:   6 − 3 + 7 − 5     = 5    → not divisible, remainder 5

A pleasant consequence is that any palindrome with an even number of digits, such as 4,774, is divisible by 11. Its matching digits fall in positions with opposite signs and cancel.

Combining rules for composite numbers

To test for 6, test 2 and 3. For 12, test 3 and 4. For 15, test 3 and 5. For 18, test 2 and 9.

The factors must be coprime, meaning they share no divisor except 1. Testing 12 with 2 and 6 fails: the number 18 is divisible by both, yet not by 12. Similarly, 12 is divisible by 4 and 6 but not by 24.

This rests on unique factorization into primes. If two coprime numbers each divide n, their prime ingredients do not overlap, so n must contain all of them at once. In general, test each prime power in the divisor separately. For 72 = 8 × 9, check the last three digits and the digit sum.

Trimming rules for 7, 13 and 17

For 7, remove the last digit, double it, and subtract it from what remains. Repeat until the number is small.

3192:  319 − 2×2 = 315
       31 − 2×5  = 21    → divisible by 7

To see why, write the number as 10a + b. Then

10 × (a − 2b) = 10a − 20b = (10a + b) − 21b

Since 21 is a multiple of 7, the right side is divisible by 7 exactly when 10a + b is. And since 10 shares no factor with 7, the left side is divisible by 7 exactly when a − 2b is.

The same design gives other rules.

Divisor New number from 10a + b Because
7 a − 2b 21 = 3 × 7
13 a + 4b 39 = 3 × 13
17 a − 5b 51 = 3 × 17
19 a + 2b 19b appears in 20b − b

These steps preserve whether the number is divisible, but not the remainder. If you need the remainder, use the method below or divide.

Three families of divisibility tests
Final digits 2, 5 and 10: last digit 4 and 25: last two 8 and 125: last three Digit sums 3 and 9: add all digits 11: add and subtract in turn Result has the same remainder Trim and adjust 7: subtract twice the last digit 13: add four times it 17: subtract five times it Final digits 2, 5 and 10: last digit 4 and 25: last two 8 and 125: last three Digit sums 3 and 9: add all digits 11: add and subtract in turn Result has the same remainder Trim and adjust 7: subtract twice the last digit 13: add four times it 17: subtract five times it

One number, tested all the way

Putting the rules side by side shows how fast they are. Take 9,240 and ask which numbers from 2 to 12 divide it.

The last digit is 0, so 2, 5 and 10 all work. The last two digits make 40, so 4 works. The last three make 240, which is 8 × 30, so 8 works. The digit sum is 9 + 2 + 4 + 0 = 15, so 3 works but 9 does not. Since both 2 and 3 work, so does 6, and since 3 and 4 work, so does 12.

For 7, trim the final 0 to get 924, then 92 − 8 = 84, which is 7 × 12. For 11, the alternating sum from the right is 0 − 4 + 2 − 9 = −11, so 11 works too.

That leaves only 9 as a failure. In under a minute you have learned that 9,240 is divisible by 8, 3, 5, 7 and 11. Their product is 9,240 itself, so you have found its full prime factorization: 2³ × 3 × 5 × 7 × 11.

Counting with remainders

The rules also help in everyday arrangements. Suppose 138 chairs must be set out in equal rows. The number is even and its digit sum is 12, so 2, 3 and 6 work. Rows of 6 give 23 rows exactly.

The digit sum for 4 is no help, since 4 uses the last two digits: 38 is not a multiple of 4, so four per row leaves chairs over. In fact 38 leaves remainder 2 on division by 4, and so does 138. The final-digit rules, like the digit-sum rules, give you the remainder as well as a yes or no.

This is worth remembering when a rule says "no". You can often say how far off the number is. A digit sum of 14 means the number leaves remainder 5 on division by 9, so subtracting 5 or adding 4 reaches the nearest multiples.

Building your own rule with weights

For any divisor, list the remainders of 1, 10, 100 and so on. For 7 they run 1, 3, 2, 6, 4, 5 and then repeat. Multiply each digit, starting from the right, by the matching weight and add.

3192:  2×1 + 9×3 + 1×2 + 3×6 = 2 + 27 + 2 + 18 = 49
49 = 7 × 7, so 3192 is divisible by 7

This is modular arithmetic at work, and it yields the true remainder.

There is also a neat shortcut for three divisors at once. Since 7 × 11 × 13 = 1,001, split a long number into groups of three digits from the right and take an alternating sum of the groups. For 2,853,214, that is 214 − 853 + 2 = −637. Because 637 = 7 × 7 × 13, the original number is divisible by 7 and 13 but not by 11.

Other bases and practical uses

The rules depend on how numbers are written, though divisibility itself does not. In base b, the final-digit test works for divisors of b, the digit sum works for divisors of b − 1, and the alternating sum works for divisors of b + 1. In hexadecimal, that gives a digit-sum test for 3, 5 and 15, and an alternating test for 17.

The tests are handy when simplifying fractions. Take 2,052/2,430. Both are even, giving 1,026/1,215. Both digit sums are 9, so divide by 9 to get 114/135. Both are still divisible by 3, which leaves 38/45, and no common factor remains.

They also shorten the hunt for prime factors. To decide whether a number is prime, you need only try primes up to its square root, as described in prime numbers from the ground up. For 221, the square root is just under 15. The tests rule out 2, 3, 5, 7 and 11, but 13 gives 22 + 4 = 26, so 221 = 13 × 17.

Common questions

Is there a test for every number?

Yes. The weights method works for any positive divisor. Whether it is quicker than dividing is another matter, and for large primes it usually is not.

Can I apply a rule repeatedly?

Yes, for digit sums, alternating sums and trimming rules. Each step gives a smaller number with the same answer to the yes-or-no question. Stop when you recognize the result.

Why do the trimming rules ask for coprime numbers?

The argument for 7 says that 10 × (a − 2b) and 10a + b differ by a multiple of 7. To move from "7 divides 10 × (a − 2b)" to "7 divides a − 2b", you need 7 to share no factor with 10. That is why this style of rule works for divisors ending in 1, 3, 7 or 9, and why 2 and 5 are handled by final digits instead.

Can a rule give a wrong answer?

Not if you carry it out correctly, because each is a proven equivalence. Slips usually come from starting the alternating sum at the wrong end, forgetting that a negative result can still be divisible, or applying a combination such as 4 and 6 that is not coprime.

How should these be taught?

Many teachers have students discover a rule from a list of multiples, then explain it with place-value blocks. The explanation matters more than the memorized phrase, because a student who understands the 9 rule can rebuild the 3 rule and extend the idea to new divisors.

Written for 4Mathematics with AI writing tools and not reviewed line by line by a person. Check anything you rely on against a textbook or primary source. Report an error.

Keep reading

All 38 articles in Numbers and Arithmetic →

Latest news on this topic