A divisibility rule decides from the digits alone whether a number is divisible by 2, 3, 4, 5, 6, 8, 9, 10 or 25. This lesson proves each rule from place value and the distributive property: the last digits decide for 2, 4, 5, 8, 10 and 25, the sum of the digits decides for 3 and 9, and the two together decide for 6.
The idea behind every rule
Dividing always settles whether d divides N (lesson “Divisibility”). For some divisors there are much quicker tests, read off the digits: the patterns of the multiples of a number give tests for divisibility,[1] and they decide without performing the actual division.[2]
Every test below is proved in the same three steps.
- Split N into two parts, N = M + R, using place value. By the lesson “Dividing by 10, 100 and 1000”, N = T × 10 + u, where u is the ones digit and T is named by the other digits; in the same way N = H × 100 + s, where s is named by the last two digits, and N = K × 1,000 + t, where t is named by the last three.
- Show that d divides the large part M for every N.
- Then, by the Corollary of the lesson “Divisibility”, d | N exactly when d | R: only the small part R has to be tested.
The last digit: 2, 5 and 10
Let u be the ones digit of a whole number N.
- 10 | N exactly when u = 0.
- 5 | N exactly when u is 0 or 5.
- 2 | N exactly when u is 0, 2, 4, 6 or 8.
Moreover, for d = 2, 5 or 10, N leaves the same remainder as u on division by d.
Write N = T × 10 + u. Each d = 2, 5, 10 divides 10, since 10 = 5 × 2 = 2 × 5 = 1 × 10; write 10 = k × d. By the rule on multiples, d divides T × 10 = T × (k × d) = (T × k) × d. So by the Corollary, d | N exactly when d | u. The digit u is one of 0, 1, …, 9, and among these the multiples of 10 are 0; of 5, 0 and 5; of 2, 0, 2, 4, 6 and 8.
For the remainders, divide u by d: u = q × d + r with 0 ≤ r < d. Then N = (T × k) × d + q × d + r = (T × k + q) × d + r by the distributive property,[3] and 0 ≤ r < d. By the uniqueness in the division algorithm, r is also the remainder of N.
These are the standard tests: a number is divisible by 10 if its last digit is 0,[4] by 5 exactly when its units digit is 0 or 5,[5]
Which of 2, 5 and 10 divide 4,730? Which divide 4,735?
- 4,730 ends in 0: divisible by 10, by 5 and by 2. Indeed 4,730 = 473 × 10.
- 4,735 ends in 5: divisible by 5, but not by 10 (the digit is not 0) or by 2 (5 is odd). Indeed 4,735 = 947 × 5.
- The remainders of 4,735 are those of its last digit 5: on division by 2 it is 1 (5 = 2 × 2 + 1), and on division by 10 it is 5.
Answer: 2, 5 and 10 divide 4,730; only 5 divides 4,735. Check: 4,735 = 2,367 × 2 + 1 and 4,735 = 473 × 10 + 5.
The last two or three digits: 4, 25 and 8
Let s be the number named by the last two digits of N, and t the number named by its last three digits (N itself, if N has fewer digits).
- 4 | N exactly when 4 | s.
- 25 | N exactly when s is 0, 25, 50 or 75, that is, when the last two digits are 00, 25, 50 or 75, or N = 0.
- 8 | N exactly when 8 | t.
Write N = H × 100 + s. Since 100 = 25 × 4 = 4 × 25, both 4 and 25 divide 100, and so they divide H × 100 by the rule on multiples. By the Corollary, 4 | N exactly when 4 | s, and 25 | N exactly when 25 | s. The numbers from 0 to 99 that 25 divides are 0, 25, 50 and 75.
Write N = K × 1,000 + t. Since 1,000 = 125 × 8, 8 divides 1,000 and hence K × 1,000. By the Corollary, 8 | N exactly when 8 | t.
The same tests appear in the textbooks: 4 divides a number exactly when it divides the number formed by its tens and units digits,[9]
For 4 the last digit alone is not enough, because 10 is not a multiple of 4: 16 and 26 both end in 6, but 16 = 4 × 4 while 26 = 6 × 4 + 2. For 8 the last two digits are not enough, because 100 is not a multiple of 8: 100 and 200 both end in 00, but 100 = 12 × 8 + 4 while 200 = 25 × 8. A test may look only at the digits whose place values are not already multiples of the divisor.
Does 4 divide 7,316? Does 25 divide 7,350? Does 8 divide 51,264?
- 7,316: the last two digits name 16 = 4 × 4. So 4 | 7,316. Indeed 7,316 = 1,829 × 4.
- 7,350: the last two digits are 50, one of 00, 25, 50, 75. So 25 | 7,350. Indeed 7,350 = 294 × 25.
- 51,264: the last three digits name 264 = 33 × 8. So 8 | 51,264. Indeed 51,264 = 6,408 × 8.
Answer: yes, yes, yes. Check: 1,829 × 4 = 7,316; 294 × 25 = 7,350; 6,408 × 8 = 51,264.
Someone says that 1,234 is divisible by 4 “because it ends in 4”. Check it.
- The test for 4 looks at the last two digits: 34.
- 34 = 8 × 4 + 2, so 4 ∤ 34, and therefore 4 ∤ 1,234.
- Check: 1,234 = 308 × 4 + 2.
Answer: 1,234 is not divisible by 4; its remainder is 2.
The sum of the digits: 9 and 3
The place values are each one more than a number written with nines only: 10 = 9 + 1, 100 = 99 + 1, 1,000 = 999 + 1, and so on. Every number written with nines only is a multiple of 9: by the distributive property, 9 × 111 = 9 × (100 + 10 + 1) = 900 + 90 + 9 = 999, and in the same way the number written with any count of nines is 9 times the number written with that many ones.
A whole number N and the sum S of its digits leave the same remainder on division by 9, and the same remainder on division by 3. In particular, 9 | N exactly when 9 | S, and 3 | N exactly when 3 | S.
Write N in expanded form, each digit times its place value; for a four-digit number with digits a, b, c, u, N = a × 1,000 + b × 100 + c × 10 + u. Replace each place value by its nines plus 1 and use the distributive property: a × 1,000 = a × 999 + a, b × 100 = b × 99 + b, c × 10 = c × 9 + c. So
N = (a × 999 + b × 99 + c × 9) + (a + b + c + u) = M + S.
Each of 999, 99 and 9 is a multiple of 9, so by the rules on multiples and sums, 9 | M; write M = m × 9. The same works for any number of digits. Now divide S by 9: S = q × 9 + r with 0 ≤ r < 9. Then N = m × 9 + q × 9 + r = (m + q) × 9 + r, so by the uniqueness in the division algorithm N also has remainder r.
For 3: since 9 = 3 × 3, M = m × 9 = (m × 3) × 3. If S = q′ × 3 + r′ with 0 ≤ r′ < 3, then N = (m × 3 + q′) × 3 + r′, and N has the remainder r′ too. A remainder is 0 exactly when the divisor divides the number, which gives the two tests.
These are the classical tests: a positive integer is divisible by 9 exactly when the sum of its digits is,[13] and divisible by 3 exactly when the sum of its digits is.[14]
Find the remainders of 98,765 on division by 9 and by 3, without dividing.
- Digit sum: 9 + 8 + 7 + 6 + 5 = 35. Digit sum of 35: 3 + 5 = 8.
- So 98,765, 35 and 8 all leave the same remainder on division by 9: 8. So 9 ∤ 98,765.
- On division by 3: 35 = 11 × 3 + 2, remainder 2. So 3 ∤ 98,765, and its remainder is 2.
Answer: remainder 8 on division by 9, remainder 2 on division by 3. Check: 10,973 × 9 + 8 = 98,757 + 8 = 98,765, and 32,921 × 3 + 2 = 98,763 + 2 = 98,765.
Is 6,831 divisible by 9? By 3?
- Digit sum: 6 + 8 + 3 + 1 = 18 = 2 × 9.
- So 9 | 6,831, and since 3 | 9, also 3 | 6,831 by the rule on chains.
Answer: yes to both. Check: 6,831 = 759 × 9 = 2,277 × 3.
The digits of 13 add up to 4. Does that make 13 divisible by 4?
- 13 = 3 × 4 + 1, so 4 ∤ 13, although 4 divides its digit sum.
- The digit sum works for 9 and 3 because every place value is 1 more than a multiple of 9. It is not 1 more than a multiple of 4: 10 = 2 × 4 + 2.
- The test for 4 uses the last two digits instead: 13 = 3 × 4 + 1, remainder 1.
Answer: no. The digit-sum test is valid only for 3 and 9.
Two tests together: 6
6 | N exactly when 2 | N and 3 | N.
If 6 | N, then 2 | N and 3 | N by the rule on chains, because 2 | 6 and 3 | 6.
Conversely, let 2 | N and 3 | N, and write N = k × 3. By the distributive property, k × 3 = k × 2 + k. Since 2 | k × 2, the Corollary of the lesson “Divisibility” says that 2 | N exactly when 2 | k; and 2 | N, so 2 | k. Write k = j × 2. Then N = (j × 2) × 3 = j × 6 by the associative property,[16] so 6 | N.
So a number is divisible by 6 if it is divisible by both 2 and 3.[17]
Which of 5,316, 4,321 and 2,354 are divisible by 6?
- 5,316 ends in 6, so it is even; its digit sum is 5 + 3 + 1 + 6 = 15 = 5 × 3. Both tests pass: 6 | 5,316.
- 4,321 ends in 1, so it is odd: 2 ∤ 4,321, and so 6 ∤ 4,321.
- 2,354 is even, but its digit sum is 14 = 4 × 3 + 2: 3 ∤ 2,354, so 6 ∤ 2,354.
Answer: only 5,316. Check: 5,316 = 886 × 6; 4,321 = 720 × 6 + 1; 2,354 = 392 × 6 + 2.
Two tests cannot always be combined like this. 2 | 12 and 4 | 12, but 8 ∤ 12; 4 | 12 and 6 | 12, but 24 ∤ 12. In both failing pairs the two divisors share the factor 2, while 2 and 3 have no common factor except 1. When two tests can be combined is settled in the lesson “Finding the GCD from prime factorizations”: the tests for a and b combine into a test for a × b whenever a and b have no common factor except 1.
The rules at a glance
| d | d | N exactly when | Why |
|---|---|---|
| 2 | the last digit is 0, 2, 4, 6 or 8 | 2 | 10 |
| 5 | the last digit is 0 or 5 | 5 | 10 |
| 10 | the last digit is 0 | 10 | 10 |
| 4 | 4 divides the number named by the last two digits | 4 | 100 |
| 25 | the last two digits are 00, 25, 50 or 75 | 25 | 100 |
| 8 | 8 divides the number named by the last three digits | 8 | 1,000 |
| 3 | 3 divides the sum of the digits | place values are 1 more than multiples of 9 |
| 9 | 9 divides the sum of the digits | the same |
| 6 | 2 | N and 3 | N | 6 = 2 × 3, combined as in Section 5 |
Test the digits
- Round
- 1
- Score
- 0
- Streak
- 0
Is 774,693 divisible by 9? Tap the digits that the test for 9 looks at, read what they give, then answer.
No digit selected yet.
There are tests for other divisors too. For example, a number is divisible by 11 exactly when the alternating sum of its digits is.[18] The alternating sum can fall below zero, so this test and its proof belong to the unit Congruences, lesson “Modular arithmetic”.
Exercises
Which of 2, 3, 4, 5, 6, 8, 9, 10 and 25 divide 7,200?
▸ Show solution
- The last digit is 0: 2, 5 and 10 divide 7,200.
- The last two digits are 00: 4 and 25 divide it (4 | 0 and 25 | 0).
- The last three digits name 200 = 25 × 8: 8 divides it.
- The digit sum is 7 + 2 = 9: 3 and 9 divide it.
- 2 and 3 divide it, so 6 does. All nine numbers divide 7,200. Check: 7,200 = 900 × 8 = 800 × 9 = 288 × 25.
Without dividing, find the remainders of 123,456 on division by 9 and by 3.
▸ Show solution
The digit sum is 1 + 2 + 3 + 4 + 5 + 6 = 21, and the digit sum of 21 is 3. So the remainder on division by 9 is 3. On division by 3, 21 = 7 × 3, remainder 0: 3 | 123,456. Check: 13,717 × 9 + 3 = 123,453 + 3 = 123,456, and 41,152 × 3 = 123,456.
Which digits can fill the box in 4□8 to make a number divisible by 9? By 3?
▸ Show solution
The digit sum of 4□8 is 4 + □ + 8 = 12 + □, which lies between 12 and 21. For 9 it must be 18, so □ = 6: 468 = 52 × 9.
For 3 it must be 12, 15, 18 or 21, so □ is 0, 3, 6 or 9: 408, 438, 468 and 498.
Test 2,936 for divisibility by 4, 25 and 8.
▸ Show solution
The last two digits name 36 = 9 × 4, so 4 | 2,936. They are not 00, 25, 50 or 75, so 25 ∤ 2,936. The last three digits name 936 = 117 × 8, so 8 | 2,936. Check: 2,936 = 734 × 4 = 367 × 8.
Find and prove a test for divisibility by 20 that uses the last two digits.
▸ Show solution
Write N = H × 100 + s, with s named by the last two digits. Since 100 = 5 × 20, 20 | H × 100, so 20 | N exactly when 20 | s. The numbers from 0 to 99 divisible by 20 are 0, 20, 40, 60 and 80. So 20 | N exactly when the last digit is 0 and the tens digit is even (0, 2, 4, 6 or 8).
Prove that 12 | N exactly when 3 | N and 4 | N. Use it to test 516.
▸ Show solution
If 12 | N, then 3 | N and 4 | N by the rule on chains, since 3 | 12 and 4 | 12. Conversely, let 3 | N and 4 | N, and write N = k × 4 = k × 3 + k. Since 3 | k × 3, the Corollary gives 3 | k; write k = j × 3. Then N = (j × 3) × 4 = j × 12.
Example: 516 has digit sum 12 and last two digits 16 = 4 × 4, so 12 | 516; indeed 516 = 43 × 12.
A number is written with its digits in a different order (for example 6,831 and 1,368). Explain why the two numbers leave the same remainder on division by 9, and why their difference is divisible by 9.
▸ Show solution
Rearranging the digits does not change their sum. A number and its digit sum leave the same remainder on division by 9, so the two numbers leave the same remainder. Their difference is then a multiple of 9: if N = q × 9 + r and N′ = q′ × 9 + r with q′ ≤ q, then N − N′ = (q − q′) × 9. Example: 6,831 − 1,368 = 5,463 = 607 × 9.
Summary
- Each test splits N by place value into a part the divisor surely divides and a small rest; then d | N exactly when d divides the rest.
- 2, 5 and 10 divide 10, so the last digit decides; 4 and 25 divide 100, so the last two digits decide; 8 divides 1,000, so the last three decide.
- Every place value is 1 more than a multiple of 9, so N and its digit sum leave the same remainder on division by 9 and by 3.
- 6 | N exactly when 2 | N and 3 | N; not every pair of tests combines this way (2 | 12 and 4 | 12, but 8 ∤ 12).
Sources
- 1.Lynn Marecek, MaryAnne Anthony-Smith and Andrea Honeycutt Mathis, Prealgebra (2nd ed., OpenStax, Rice University, 2020).Chapter 2, “The Language of Algebra”, section 2.4, “Find Multiples and Factors” (“Use Common Divisibility Tests”), p. 144 (the whole topic: pp. 144–146).
“Since multiplication and division are inverse operations, the patterns of multiples that we found can be used as divisibility tests.”
Used for: the patterns of multiples give tests for divisibility. - 2.David M. Burton, Elementary Number Theory (7th ed., McGraw-Hill, 2011).Chapter 4, “The Theory of Congruences”, section 4.3, “Binary and Decimal Representations of Integers”, p. 71 (the whole topic: pp. 71–72).
“We are about ready to derive criteria for determining whether an integer is divisible by 9 or 11, without performing the actual division.”
Used for: divisibility tests decide without performing the actual division. - 3.Michelle Manes, “Properties of Operations”, Mathematics for Elementary Teachers, University of Hawaiʻi (Pressbooks) (2018).Section “Multiplication Distributes over Addition”. pressbooks.oer.hawaii.edu/mathforelementaryteachers/chapter/properties-of-operations · open at the quoted passage.
“Multiplication distributes over addition.”
Used for: the distributive property of multiplication over addition, used in the proofs of this lesson. - 4.Lynn Marecek, MaryAnne Anthony-Smith and Andrea Honeycutt Mathis, Prealgebra (2nd ed., OpenStax, Rice University, 2020).Chapter 2, “The Language of Algebra”, section Chapter Review, “Key Concepts”, 2.4, “Find Multiples and Factors”: table “Divisibility Tests” (“A number is divisible by …”), p. 164 (the whole topic: pp. 144–145).
“10 if the last digit is 0”
Used for: a number is divisible by 10 if its last digit is 0. - 5.David M. Burton, Elementary Number Theory (7th ed., McGraw-Hill, 2011).Chapter 4, “The Theory of Congruences”, section 4.3, “Binary and Decimal Representations of Integers”, Problem 7(d), p. 74 (the whole topic: pp. 71–74).
“An integer is divisible by 5 if and only if its units digit is 0 or 5.”
Used for: a number is divisible by 5 exactly when its units (ones) digit is 0 or 5. - 6.Lynn Marecek, MaryAnne Anthony-Smith and Andrea Honeycutt Mathis, Prealgebra (2nd ed., OpenStax, Rice University, 2020).Chapter 2, “The Language of Algebra”, section Chapter Review, “Key Concepts”, 2.4, “Find Multiples and Factors”: table “Divisibility Tests” (“A number is divisible by …”), p. 164 (the whole topic: pp. 144–145).
“5 if the last digit is 5 or 0”
Used for: a number is divisible by 5 if its last digit is 5 or 0. - 7.David M. Burton, Elementary Number Theory (7th ed., McGraw-Hill, 2011).Chapter 4, “The Theory of Congruences”, section 4.3, “Binary and Decimal Representations of Integers”, Problem 7(a), p. 74 (the whole topic: pp. 71–74).
“An integer is divisible by 2 if and only if its units digit is 0, 2, 4, 6, or 8.”
Used for: a number is divisible by 2 exactly when its units digit is 0, 2, 4, 6 or 8. - 8.Kenneth H. Rosen, Discrete Mathematics and Its Applications (8th ed., McGraw-Hill, 2019).Chapter 4, “Number Theory and Cryptography”, section 4.2, “Integer Representations and Algorithms”, Exercise 34, p. 270 (the whole topic: pp. 270).
“Determine how we can use the decimal expansion of an integer n to determine whether n is divisible by a) 2 b) 5 c) 10”
Used for: the tests for 2, 5 and 10 come from the decimal expansion of the number. - 9.David M. Burton, Elementary Number Theory (7th ed., McGraw-Hill, 2011).Chapter 4, “The Theory of Congruences”, section 4.3, “Binary and Decimal Representations of Integers”, Problem 7(c), p. 74 (the whole topic: pp. 71–74).
“An integer is divisible by 4 if and only if the number formed by its tens and units digits is divisible by 4.”
Used for: 4 divides a number exactly when it divides the number formed by its last two (tens and units) digits. - 10.Lynn Marecek, MaryAnne Anthony-Smith and Andrea Honeycutt Mathis, Prealgebra (2nd ed., OpenStax, Rice University, 2020).Chapter 2, “The Language of Algebra”, section Chapter Review, “Key Concepts”, 2.4, “Find Multiples and Factors”: table “Divisibility Tests” (“A number is divisible by …”), p. 164 (the whole topic: pp. 144–145).
“4 if the last two digits are a number divisible by 4”
Used for: a number is divisible by 4 if its last two digits name a number divisible by 4. - 11.Kenneth H. Rosen, Discrete Mathematics and Its Applications (8th ed., McGraw-Hill, 2019).Chapter Answers to Odd-Numbered Exercises, section Section 4.2, Exercise 35(b), pp. S-25 (the whole topic: pp. S-25).
“n is divisible by 25 if and only if the two rightmost digits are 00 (or 0 if it’s a one-digit integer), 25, 50, or 75.”
Used for: 25 divides a number exactly when its last two digits are 00, 25, 50 or 75. - 12.David M. Burton, Elementary Number Theory (7th ed., McGraw-Hill, 2011).Chapter 4, “The Theory of Congruences”, section 4.3, “Binary and Decimal Representations of Integers”, Problem 16, p. 74 (the whole topic: pp. 71–74).
“Show that 2ⁿ divides an integer N if and only if 2ⁿ divides the number made up of the last n digits of N.”
Used for: the test for 8: with n = 3 (8 = 2 × 2 × 2), 8 divides N exactly when it divides the number made up of the last three digits; with n = 2 it is the test for 4. - 13.David M. Burton, Elementary Number Theory (7th ed., McGraw-Hill, 2011).Chapter 4, “The Theory of Congruences”, section 4.3, “Binary and Decimal Representations of Integers”, p. 72 (the whole topic: pp. 71–72).
“A positive integer is divisible by 9 if and only if the sum of the digits in its decimal representation is divisible by 9.”
Used for: the test for 9 by the sum of the digits. - 14.David M. Burton, Elementary Number Theory (7th ed., McGraw-Hill, 2011).Chapter 4, “The Theory of Congruences”, section 4.3, “Binary and Decimal Representations of Integers”, Problem 7(b), p. 74 (the whole topic: pp. 71–74).
“An integer is divisible by 3 if and only if the sum of its digits is divisible by 3.”
Used for: the test for 3 by the sum of the digits. - 15.Lynn Marecek, MaryAnne Anthony-Smith and Andrea Honeycutt Mathis, Prealgebra (2nd ed., OpenStax, Rice University, 2020).Chapter 2, “The Language of Algebra”, section Chapter Review, “Key Concepts”, 2.4, “Find Multiples and Factors”: table “Divisibility Tests” (“A number is divisible by …”), p. 164 (the whole topic: pp. 144–145).
“3 if the sum of the digits is divisible by 3”
Used for: a number is divisible by 3 if the sum of its digits is divisible by 3. - 16.Lynn Marecek, MaryAnne Anthony-Smith and Andrea Honeycutt Mathis, Prealgebra (2nd ed., OpenStax, Rice University, 2020).Chapter 7, “The Properties of Real Numbers”, section 7.2, “Commutative and Associative Properties” (“Use the Commutative and Associative Properties”), p. 548 (the whole topic: pp. 546–549).
“When multiplying three numbers, changing the grouping of the numbers does not change the result. This is known as the Associative Property of Multiplication.”
Used for: the associative property of multiplication: (j × 2) × 3 = j × (2 × 3). - 17.Lynn Marecek, MaryAnne Anthony-Smith and Andrea Honeycutt Mathis, Prealgebra (2nd ed., OpenStax, Rice University, 2020).Chapter 2, “The Language of Algebra”, section Chapter Review, “Key Concepts”, 2.4, “Find Multiples and Factors”: table “Divisibility Tests” (“A number is divisible by …”), p. 164 (the whole topic: pp. 144–145).
“6 if divisible by both 2 and 3”
Used for: a number is divisible by 6 if it is divisible by both 2 and 3. - 18.David M. Burton, Elementary Number Theory (7th ed., McGraw-Hill, 2011).Chapter 4, “The Theory of Congruences”, section 4.3, “Binary and Decimal Representations of Integers”, p. 72 (the whole topic: pp. 71–72).
“an integer is divisible by 11 if and only if the alternating sum of its digits is divisible by 11.”
Used for: the test for 11 by the alternating sum of the digits (Theorem 4.6, proved there with congruences).