Look at the barcode on any packet in your kitchen. Under the stripes there is usually a 13-digit number (in many countries; North America also uses 12-digit codes). The last digit is special: it is a check digit. It is chosen so that the scanner can tell, in a split second, if a digit was read wrongly.
Here is how the check works on these 13-digit codes (this is the real rule; the code below is made up):
- Multiply the digits by in turn, from the left (the last digit is multiplied by ).
- Add everything up. For this code the total is .
- If the total divides exactly by , the scanner beeps βOKβ. If not, it asks for the code again.
How can the scanner tell at once whether divides by ? And how could you tell whether a big number divides by , or , or , without doing the division?
Try these first. Nothing is marked: just have a go and keep your answers in mind.
Which number of sweets can be shared equally between 2 people, with none left over? Try to decide without dividing.
What is the remainder when is divided by ?
What is the remainder when is divided by ?
One million, , is shared out into groups of . How many are left over?
In the explorer below, the number is built from hundreds, tens and ones blocks. Start with and divide by 9.
- Each hundred is drawn as and one orange piece; each ten as and one orange piece. Why do the s and s share into nines exactly? How many orange pieces are left over? Compare it with .
- Change the number. Does the count of leftovers always match the sum of the digits? Now divide by 3. What changes, and what stays the same?
- Now divide by 2, 5 and 10. Which blocks share out exactly? Which digit decides?
- Now divide by 4. Which blocks share out exactly now? Try . What does adding up the digits say, and is it right?
- Try-first 1. Only can be shared equally between 2 people. To decide, you only needed the last digit: is even, while , and end in odd digits. The tens, hundreds and thousands always share into twos.
- Try-first 2 and 3. leaves remainder , and . leaves remainder , and . That is not luck: in the explorer, the leftovers after taking out every and are exactly the sum of the digits.
- Dividing by gives the same picture, because and are multiples of too.
- For , and , every ten shares out exactly, so only the ones digit matters.
- For , a ten does not share into fours (), but a hundred does (). So the last two digits decide. Adding up the digits gives wrong answers for : for , leaves remainder , but leaves remainder .
Tests that look at the last digits
A whole number is divisible by another when it divides exactly, with remainder .
| divisible by | test |
|---|---|
| the last digit is even: or | |
| the last digit is or | |
| the last digit is | |
| the number made by the last two digits is divisible by |
Examples: is divisible by (it ends in ). is divisible by , because .
Write the number as tens and ones: . Every is , so the tens always share exactly into twos, into fives and into tens. Whatever is left to decide is in the ones digit, .
For , write the number as hundreds and the rest: . Every is , so the hundreds always share into fours. Only the last two digits, , are left to decide.
Tests that use the digit sum
The digit sum of a number is what you get by adding its digits: the digit sum of is .
| divisible by | test |
|---|---|
| the digit sum is divisible by | |
| the digit sum is divisible by |
Even better: the remainder when a number is divided by is the same as the remainder when its digit sum is divided by . (The same is true for .)
Every ten is . Every hundred is . Every thousand is . So
The s, s and s are all multiples of (and of ), so they share out exactly. What is left over is : the digit sum. So the number shares into nines exactly when its digit sum does, and the leftovers are the same. This works for any number, because every place value () is a string of nines plus one.
The test for 6
A number is divisible by when it passes both tests: it is divisible by and by .
: the last digit is even β and the digit sum is divisible by β, so is divisible by .
Count the multiples of : , that is Three times an even number is even, and three times an odd number is odd (odd + odd + odd is odd). So the even multiples of are exactly , which are : the multiples of . So a number that is a multiple of and even is a multiple of .
- needs both tests. Ending in is not enough: ends in but leaves remainder .
- The digit sum only works for and . For , has digit sum , which is not divisible by , but is. For , has digit sum , but is not divisible by . The reason: is special to (and ).
- The test for uses the last two digits as a number, not their sum: for , look at , not .
- Divisible by and by does not mean divisible by . is divisible by and by , but not by .
- A test answers βyes or noβ. The last-digit tests also give the remainder for , and (from the last digit) and the digit sum gives it for and . They do not tell you the answer of the division.
Testing 7 452
Which of divide exactly?
Step 1: The last digit
The last digit is : even, so divisible by β. Not or , so not divisible by or .
Step 2: The last two digits
, so is divisible by β.
Step 3: The digit sum
. is divisible by and by , so is divisible by β and by β.
Step 4: Six
Divisible by and by , so divisible by β.
Step 5: Is it sensible?
Check one of the answers by dividing: and , so β, remainder . The test for and the division agree. Any of the other answers can be checked by dividing in the same way.
Two ways to decide whether 3 132 is divisible by 6
Way 1: Divide
: , leaving , and . So , with remainder . Yes.
Way 2: Use the tests
The last digit is even β. The digit sum is divisible by β. So it is divisible by . Yes.
Which is neater?
Both say yes. Way 2 is faster and easier to do in your head: two quick checks and no long division. But Way 1 gives you more: it tells you there are groups of . If you only need yes or no, use the tests. If you need to know how many groups, divide.
Which number is divisible by ?
Use the digit sum to find the remainder when is divided by .
Still stuck after the example? Hearing it from another teacher often helps. These videos were checked against this lesson. Try the questions again afterwards.
Divisibility tests for 2, 3, 4, 5, 6, 9, 10 | Factors and multiples | Pre-Algebra | Khan Academy Β· Khan Academy Β· about 7 min
Tries the quick tests for 2, 3, 4, 5, 6, 9 and 10 on three big numbers, showing how to use the last digits and the digit sum without dividing.
Same idea, different words: This video shows how to use the tests; it says itself that it does not explain why they work. Watch the second video, or re-read the Why boxes, for the reasons.
Divisibility by 3 and by 9: Why do they work? (TANTON Mathematics) Β· DrJamesTanton Β· about 8 min
Explains why adding the digits works for 9 and for 3: every 10, 100 and 1000 is one more than a multiple of 9, so a number leaves the same remainder as its digit sum.
Same idea, different words: This teacher says 'upon division by 9' for 'when you divide by 9'. The clip stops before the extra part about 11, which uses negative remainders.
. Use this to invent a test for divisibility by . Which digits would you look at? Try it on , and check by dividing.
Which number is divisible by ?
Checking barcodes
Every 13-digit barcode number ends in a check digit. The rule (the real one) is: multiply the digits by from the left, add them up, and the total must be divisible by 10. The codes in these questions are made up, but the rule is the one shop scanners use.
A scanner reads this (made-up) barcode number:
Multiply the digits by from the left and add. What is the total? Should the scanner accept the code?
A new (made-up) product gets the first 12 digits
The 13th digit is the check digit; it is multiplied by . What must the check digit be, so that the total is divisible by ?
A barcode is smudged, and one digit cannot be read:
The missing digit is the 8th one, so it is multiplied by . The full total must be divisible by . What is the missing digit?
The shop says: "If one digit of a barcode is misread, the scanner always notices."
Explain why this is true. Think about how much the total changes when one digit is wrong, for a digit multiplied by and for a digit multiplied by . Then say why shops find a check digit useful.
π Work it out in your notebook first β sketch, calculate, then write your answer here in full sentences. A model answer appears after you submit, so you can compare.
Divisibility tests are place value at work: they come straight from the fact that our numbers are built from tens. The same thinking powers check digits on barcodes, on book numbers (ISBNs) and on bank card numbers, so that a single mistyped digit is caught. Next lesson you will meet the numbers that cannot be split into smaller factors at all: the prime numbers. The tests from today will make it much faster to decide whether a number is prime.
Explain to someone at home why the digit-sum test works for 9. Use the words '9 + 1' and '99 + 1'.
Why does the digit-sum test not work for 4? Give a number that shows it.
- Prealgebra (Art of Problem Solving) β Chapter 3, section 3.2 Divisibility Tests
The book goes deeper and its problems are harder. Read it after this lesson, with a pencil in your hand.