A number written with digits is a sum of digits times powers of 10. Each power of 10 leaves a simple remainder on division by 2, 3
Lesson 2 of 3Show all lessonsHide
Try the code and the simulations beside the lesson.
What you will be able to do
prove the divisibility rules for 2, 4, 8, 3, 9, 11, and the joint rule for 7, 11 and 13;
use the facts a−b∣an−bn and, for odd n, a+b∣an+bn;
find missing digits so that a number is divisible by a given number.
Digits are a sum
The number 4726 means 4×1000+7×100+2×10+6. A number with digits dk,…,d1,d0 is
N=dk10k+⋯+d1⋅10+d0.
We write it dk…d1d0, with a bar, so that ab is not read as a×b. Every divisibility rule comes from this sum.
Two factorisations
For any integers a and b and any whole number n≥1,
an−bn=(a−b)(an−1+an−2b+⋯+bn−1).
So a−b always divides an−bn. When n is odd, replace b by −b. This gives a+b∣an+bn for odd n.
The rules for 3 and 9
Take a=10 and b=1. Then 9∣10k−1 for every k. (These numbers are 9, 99, 999, and so on.) Now subtract the digit sum S from N:
N−S=dk(10k−1)+⋯+d1(10−1).
Every bracket is a multiple of 9. So N and S leave the same remainder on division by 9. In particular 9∣N exactly when 9∣S. Since 3∣9, the same holds for 3.
Notice how much more this says than the rule you learnt. It gives the remainder, not only a yes or a no.
The rules for 2, 4 and 8
The number 10k is divisible by 2k. So every digit from the thousands upwards contributes a multiple of 8. The number N leaves the same remainder on division by 8 as its last three digits. In the same way, the last two digits decide divisibility by 4, and the last digit decides divisibility by 2. The same reasoning works for 5, 52 and 53.
The rule for 11
Take a=10 and b=−1. Then 11∣10k−(−1)k. So 10k leaves remainder 1 on division by 11 when k is even, and remainder 10 when k is odd. Think of 10 as one less than 11, so it acts like −1. Hence N and the alternating sum
T=d0−d1+d2−d3+…
leave the same remainder on division by 11. For 4726, T=6−2+7−4=7, and indeed 4726=11×429+7.
The rule for 7, 11 and 13
Here is a fact worth remembering: 1001=7×11×13. So 1000 acts like −1 for each of these three divisors. Split N into groups of three digits from the right, and take the alternating sum of the groups. That sum leaves the same remainder as N on division by 7, by 11 and by 13.
For example, N=9876543 splits as 9∣876∣543. The alternating sum is 543−876+9=−324. The program below checks that N and −324 leave the same remainders.
Joining two rules
Suppose a number is divisible by 8 and by 11. Since 8 and 11 share no factor bigger than 1, it is divisible by 88. We use this to find missing digits.
Worked example. Find the digits x and y for which 3x46y is divisible by 88.
The rule for 8. The last three digits 46y must be a multiple of 8. The numbers 460 to 469 contain only one multiple of 8, which is 464. So y=4.
The rule for 11. The alternating sum is 4−6+4−x+3=5−x. It must be a multiple of 11. For a digit x that means 5−x=0, so x=5.
Check.35464=88×403.
Practise with new numbers
Try it in Python
The program checks the rules for 9 and 11 on every number up to 100000. Then it splits 9876543 into groups of three digits.
Common mistakes
Reading the rule for 4 as the rule for 2 twice.34 is even and 4 is even, yet 34 is not a multiple of 4. Look at the last two digits as one number.
Alternating from the wrong end. Start the alternating sum at the units digit with a plus sign.
Stopping at a yes or a no. The digit sum gives the remainder on division by 9. Use it.
Joining rules for divisors that share a factor. A number divisible by 6 and by 9 need not be divisible by 54: think of 18.
Remember these
a−b∣an−bn, and a+b∣an+bn when n is odd.
N and its digit sum leave the same remainder on division by 9 and by 3.
N and its alternating sum leave the same remainder on division by 11.
The last k digits decide divisibility by 2k and by 5k.
1001=7×11×13 gives a rule for all three.
Check yourself
Try each one on your own first. If you are stuck, open a hint. Then check with Show the answer.
What remainder does 8724015 leave on division by 9?
Is 918082 divisible by 11?
Prove that 7∣23n−1 for every whole number n≥1.
Find the digit y for which 5274y is divisible by 8.
A six-digit number has the form abcabc. Explain why it is divisible by 13.
References
David M. Burton, Elementary Number Theory, Chapter 4, section 4.3 on special divisibility tests.
Ivan Niven, Herbert S. Zuckerman and Hugh L. Montgomery, An Introduction to the Theory of Numbers, Chapter 1 on divisibility.
Enroll free in Division, Divisibility Rules and Primes
Every lesson is open to read. Enrolling also lets you:
Mark lessons done and carry on where you stopped.
Take the tests of this lesson and its course.
Count the course towards the certificate for its chapter.