Divisibility rule
From Wikipedia, the free encyclopedia
A divisibility rule is a method that can be used to determine whether a number is evenly divisible by other numbers. Divisibility rules are a shortcut for testing a number's factors without resorting to division calculations. Although divisibility rules can be defined for any base, only rules for decimal are given here.
Contents |
The rules given below transform a given number into a generally smaller number while preserving divisibility by the divisor of interest. Therefore unless otherwise noted the resulting number should be evaluated for divisibility by the same divisor.
For divisors with multiple rules, the rules are generally ordered first for those appropriate for numbers with many digits, then those useful for numbers with fewer digits.
If the result is not obvious by examination, the same or another rule should be applied to the result.
| Divisor | Divisibility Condition | Examples |
|---|---|---|
| 2 | The last digit is even (0, 2, 4, 6, or 8). | 1,294: 4 is even. |
| 3 | The sum of the digits is divisible by 3 . | 405: 4 + 0 + 5 = 9, which clearly is divisible by 3. |
| 4 | ||
| If the tens digit is odd, the last digit plus 2 is divisible by 4 (2, 6). | 5,496: 9 is odd, and 6+2 is divisible by 4. | |
| If the number formed by the last two digits is divisible by 4. | 2,092: 92 is divisible by 4. | |
| 5 | The last digit is 0 or 5. | 490: the last digit is 0. |
| 6 | It is divisible by 2 and by 3. | 24: it is divisible by 2 and by 3. |
| Sum the last digit with four times the sum of all other digits. | 1020: (1 + 0 + 2) × 4 + 0 = 12 | |
| 7 | ||
| Subtract twice the last digit from the rest of the number. | 364: 36 − (2×4) = 28. | |
| 8 | ||
| If the hundreds digit is odd, examine the number obtained by the last two digits plus 4. | 352: 52+4 = 56. | |
| Add the digits with the last digit removed, doubled, plus the last digit. | 56: (5x2) + 6 = 16. | |
| 9 | The sum of the digits is divisible by 9 . | 2,880: 2 + 8 + 8 + 0 = 18: 1 + 8 = 9. |
| 10 | The last digit is 0. | 130: the last digit is 0. |
| 11 | ||
| Add the digits in blocks of two from right to left. | 627: 6 + 27 = 33. | |
| Difference the number with the last digit removed with the last digit. | 627: 62 - 7 = 55. | |
| Add alternate digits, then difference the two sums. | 918,082: (9 + 8 + 8) - (1 + 0 + 2) = 22. | |
| 12 | It is divisible by 3 and by 4. | 324: it is divisible by 3 and by 4. |
| Subtract the number with the last digit removed, doubled, with the last digit. | 324: (32x2) − 4 = 60. | |
| 13 | ||
| Add the digits in alternate blocks of three from right to left, then subtract the two sums. | 2,911,272: − (2 + 272) + 911 = 637 | |
| Add the number with the last digit removed with 4 times the last digit. | 338: 33 + (8×4) = 65. | |
| Subtract the number with the last digit removed with 9 times the last digit. | 637: 63 − (7×9) = 0. | |
| 14 | It is divisible by 2 and by 7. | 224: it is divisible by 2 and by 7. |
| Add the number with the last two digits removed, doubled, plus the last two digits. The answer must be divisible by 7. | 364: (3x2) + 64 = 70. | |
| 15 | It is divisible by 3 and by 5. | 390: it is divisible by 3 and by 5. |
| 16 | ||
| If the thousands digit is odd, examine the number formed by the last three digits plus 8. | 3,408: 408+8 = 416. | |
| Sum the number with the last two digits removed, times 4, plus the last two digits. | 176: (1x4) + 76 = 80. | |
| 17 | Subtract the number with the last two digits removed, doubled, with the last two digits. | 187: − (1x2) + 87 = 85. |
| Alternatively subtract and add blocks of two digits from the end, doubling the last block and halving the result of the operation, rounding any decimal end result as necessary. | 20,98,65: (65 - (98x2)) : 2 + 40 = - 25.5 = 255 = 15x17 | |
| Subtract the number with the last digit removed with 5 times the last digit. | 85: − 8 + (5×5) = 17. | |
| 18 | It is divisible by 2 and by 9. | 342: it is divisible by 2 and by 9. |
| 19 | Add the number with the last digit removed with twice the last digit. | 437: 43 + (7x2) = 57. |
| 20 | It is divisible by 10, and the tens digit is even. | 360: is divisible by 10, and 6 is even. |
| If the number formed by the last two digits is divisible by 20. | 480: 80 is divisible by 20. |
First, take any number (for this example it will be 376) and note the last digit in the number, discarding the other digits. Then take that digit (6) while ignoring the rest of the number and determine if it is divisible by 2. If it is divisible by 2, then the whole number is divisible by 2.
Ex.
- 376 (The original number)
376 (Take the last digit)- 6 ÷ 2 = 3 (Check to see if the last digit is divisible by 2)
- 376 ÷ 2 = 188 (If the last digit is divisible by 2, then the whole number is divisible by 2)
First, take any number (for this example it will be 492) and add together each digit in the number (4 + 9 + 2 = 15). Then take that sum (15) and determine if it is divisible by 3. If the final number is divisible by 3, then the whole number is divisible by 3.
Ex.
- 492 (The original number)
- 4 + 9 + 2 = 15 (Add each individual digit together)
- 15 ÷ 3 = 5 (Check to see if the number received is divisible by 3)
- 492 ÷ 3 = 164 (If the number obtained by using the rule is divisible by 3, then the whole number is divisible by 3)
The basic rule for divisibility by 4 is that if the last two digits in a number is divisible by 4, the whole number is divisible by 4 (This is because 100 is divisible by 4 and so adding hundreds, thousands, etc. is simple adding another number that is divisible by 4). Because of this, if any number ends in a two digit number that you know is divisible by 4, (i.e. 24, 04, 8, etc.) then the whole number will be divisible by 4 regardless of what is before the last two digits.
First, take any number (for this example it will be 1096) and note the last two digits in the number, discarding any other digits. Then take that number (96) and determine if the tens digit (9) is even or odd.
If the tens digit is even, you will simply check to see if the last digit is divisible by 4. If it is, then the entire number is divisible by 4.
If the tens digit is odd, add 2 to the last digit (6) and check to see if that number is divisible by 4. If it is divisible by 4, then the whole number is divisible by 4.
In another method one can take any number (for this example it will be 6052) and note the last two digits in the number, discarding any other digits. Look at the number (52) formed by the last two digits and check to see if it is divisible by 4.
Alternatively, one can simply divide the number by 2, and then check the result to find if it is divisible by 2. If it is, the entire number is divisible by 2. In addition, the result of this test is the same as the original number divided by 4.
Ex.
If the 10s digit is odd
- 1096 (The original number)
1096 (Take the last two digits of the number, discarding any other digits)- 9
6(Take the tens digit, and see if the digit is even or odd) - Is 9 even or odd? = Odd (If the tens digit is odd...)
96 (...Then take the ones digit...)- 6 + 2 = 8 (...and add two)
- 8 ÷ 4 = 2 (Check to see if the number received is divisible by 4)
- 1096 ÷ 4 = 274 (If the number is divisible by 4, then the whole number is divisible by 4)
If the 10s digit is even
- 1964 (The original number)
1964 (Take the last two digits of the number, discarding any other digits)- 6
4(Take the tens digit, and see if the digit is even or odd) - Is 6 even or odd? = Even (If the tens digit is even...)
64 (...Then take the ones digit...)- 4 ÷ 4 = 1 (...and check to see if it is divisible by 4)
- 1964 ÷ 4 = 491 (If the number is divisible by 4, then the whole number is divisible by 4)
Ex.
General Rule
- 2092 (The original number)
2092 (Take the last two digits of the number, discarding any other digits)- 92 ÷ 4 = 23 (Check to see if the number is divisible by 4)
- 2092 ÷ 4 = 523 (If the number that is obtained is divisible by 4, then the whole number is divisible by 4)
Alternative Ex.
- 1720 (The original number)
- 1720 ÷ 2 = 860 (Divide the original number by 2)
- 860 ÷ 2 = 430 (Check to see if the result is divisible by 2)
- 1720 ÷ 4 = 430 (If the result is divisible by 2, then the whole number is divisible by 4)
Divisibility by 5 is easily determined by checking the last digit in the number sequence (475), and finding if it is either 5 or 0. If the last number is either 5 or 0, the entire number is divisible by 5.
If the last digit in the number is 0, then the result will be the remaining digits multiplied by two (2). For example, the number forty (40) ends in a zero (0), so take the remaning digits (4) and multiply that by two (4*2=8). The result is the same as the result of forty divided by five (40/5=8).
If the last digit in the number is 5, then the result will be the remaining digits multiplied by two (2), plus one (1). For example, the number one hundred and twenty five (125) ends in a five (5), so take the remaining digits (12), multiply them by two (12*2=24), then add one (24+1=25). The result is the same as the result of one hundred and twenty five divided by five (125/5=25).
Ex.
If The Last Digit is 0
- 110 (The original number)
110 (Take the last digit of the number, and check if it is 0 or 5)- 11
0(If it is 0, take the remaining digits, discarding the last) - 11 * 2 = 22 (Multiply the result by 2)
- 110 ÷ 5 = 22 (The Result is the same as the original number divided by 5)
If The Last Digit is 5
- 85 (The original number)
85 (Take the last digit of the number, and check if it is 0 or 5)- 8
5(If it is 5, take the remaining digits, discarding the last) - 8 * 2 = 16 (Multiply the result by 2)
- 16 + 1 = 17 (Add 1 to the result)
- 85 ÷ 5 = 17 (The Result is the same as the original number divided by 5)
Divisibility by 6 is determined by checking the original number to see if it is both an even number (divisible by 2) and divisible by 3.
Alternatively, one can check for divisibility by six by taking the number (246), dropping the last digit in the number (24 6, adding together the remaining number (24 becomes 2 + 4 = 6), multiplying that by four (6 * 4 = 24), and adding the last digit of the original number to that (24 + 6 = 30). If this number is divisible by six, the original number is divisible by 6.
If the number is divisible by six, take the original number (246) and divide it by two (246 ÷ 2 = 123). Then, take that result and divide it by three (123 ÷ 3 = 41). This result is the same as the original number divided by six (246 ÷ 6 = 41).
Ex.
General Rule
- 324 (The original number)
- 324 ÷ 3 = 108 (Check to see if the original number is divisible by 3)
- 324 ÷ 2 = 162 OR 108 ÷ 2 = 54 (Check to see if either the original number or the result of the previous equasion is divisible by 2)
- 324 ÷ 6 = 54 (If either of the tests in the last step are true, then the original number is divisible by 6. Also, the result of the second test returns the same result as the original number divided by 6)
Alternative Ex.
- 546 (The original number)
- 54
6(Drop the last digit in the number) - 5 + 4 = 9 (Add the remaining digits together)
- 9 * 4 = 36 (Multiply the result by 4)
- 36 + 6 = 42 (Add the last digit of the original number to the result)
- 42 ÷ 6 = 7 (If the result is divisible by six...)
- 546 ÷ 6 = 91 (Then the original number is divisible by six)
Divisibility by 7 is the most difficult single digit number for which to define divisibility rules. However, several rules have been devised to assist in division by 7.
One method uses the fact that 100 ≡ 1, 101 ≡ 3, 102 ≡ 2, 103 ≡ 6, 104 ≡ 4, 105 ≡ 5, 106 ≡ 1, ... (mod 7). Take each digit of the number (371) in reverse order (173), multiplying them successively by the digits 1, 3, 2, 6, 4, 5, repeating with this sequence of multipliers as long as necessary (1, 3, 2, 6, 4, 5, 1, 3, 2, 6, 4, 5, ...), and adding the products (1*1 + 7*3 + 3*2 = 1 + 21 + 6 = 28). The original number is divisible by 7 if and only if the number obtained using this procedure is divisible by 7 (hence 371 is divisible by 7 since 28 is).[1]
Another method uses the fact that 10x+y is divisible by 7 if and only if x-2y is divisible by 7. Take the original number (371), form the number consisting of all the digits of the original number except the last digit (37) and subtract from it twice the last digit (2*1). Continue to do this until a number under 20 in absolute value remains (371 → 37-2=35 → 3-10=-7). The original number is divisible by 7 if and only if the number obtained using this procedure is divisible by 7 (hence 371 is divisible by 7 since -7 is).
First Method Example
1050 → 0501 (reverse) → 0*1 + 5*3 + 0*2 + 1*6 = 0 + 15 + 0 + 6 = 21 (multiply and add). ANSWER: 1050 is divisible by 7.
Second Method Example
1050 → 105-0=105 → 10-10=0. ANSWER: 1050 is divisible by 7.
Vedic Method of Divisibility by Osculation
Divisibility by seven can be tested by multiplication by the Ekhādika. Convert the divisor seven to the nines family by multiplying by seven. 7x7=49. Add one, drop the units digit and, take the 5, the Ekhādika, as the multiplier. Start on the right. Multiply by 5, add the product to the next digit to the left. Set down that result on a line below that digit. Repeat that method of multiplying the units digit by five and adding that product to the number of tens. Add the result to the next digit to the left. Write down that result below the digit. Continue to the end. If the end result is zero or a multiple of seven, then yes, the number is divisible by seven. Otherwise, it is not. This follows the Vedic ideal, one-line notation.[2]
Vedic Method Example:
Is 438,722,025 divisible by seven? Multiplier = 5. 4 3 8 7 2 2 0 2 5 42 37 46 37 6 40 37 27 YES
Pohlman-Mass Method of Divisibility by Seven
The Pohlman-Mass Method provides a quick, perhaps easier, solution that can determine if most integers are divisible by seven in three steps or less.
Step A: If the integer is less than 100, it is easy to know if it is a multiple of seven by inspection. if the number is between 100 and 1,000, subtract twice the last digit from the number formed by the remaining digits. If the result is a multiple of seven, then so is the original number. For example:
98 is divisible by 7 by inspection. 112 -> 11 - (2*2) = 11 - 4 = 7
An interesting pattern develops for repeated sets of 1, 2, or 3 digits that form 6-digit numbers (leading zeros are allowed) in that all such numbers are divisible by seven. This also works for 12-digit numbers and so forth. For example:
111,111 / 7 = 15,873 222,222 / 7 = 31,746
01 01 01 = 10,101 / 7 = 1,443 10 10 10 = 101,010 / 7 = 14,430
001 001 = 1,001 / 7 = 143 010 010 = 10,010 / 7 = 1,430 011 011 = 11,011 / 7 = 1,573 100 100 = 100,100 / 7 = 14,300 101 101 = 101,101 / 7 = 14,443 110 110 = 110,110 / 7 = 15,730
576,576 / 7 = 82,368 576,576,576,576 / 7 = 82,368,082,368
This phenomenon forms the basis for Steps B and C.
Step B: If the integer is between 1,001 and one million, find a repeating pattern of 1, 2, or 3 digits that forms a 6-digit number that is close to the integer. If the positive difference is less than 1,000, apply Step A. If the number is larger than 1,000, repeat Step B. For example:
341,355 - 341,341 = 14 / 7 = 2
The fact that 999,999 is a multiple of 7 can be used for determining divisibilty of integers larger than one million by reducing the integer to a 6-digit number that can be determined using Step B.
Step C: If the integer is larger than one million, subtract the nearest multiple of 999,999 and then apply Step B. For even larger numbers, use larger sets such as 12-digits (999,999,999,999) and so on. Then, break the integer into a smaller number that can be solved using Step B.
Pohlman-Mass Method of Divisibility of Seven Example:
Is 42,341,530 divisible by seven? 42,341,530 - (999,999 * 42) = 42,341,530 - 41,999,958 = 341,572 (Step C) 341,572 - 341,341 = 231 (Step B) 231 -> 23 - (1*2) = 23 - 2 = 21 YES (Step A)
Divisibility properties can be determined in two ways, depending on the type of the divisor.
Composite divisors
A number is divisible by a given divisor, if it is divisible by the highest power of each of its prime factors. For example, to determine divisibility by 24, one would check divisibility by 8 and by 3. Note that checking 4 and 6, or 2 and 12, would not be sufficient. A table of prime factors may be useful.
A composite divisor may also have a rule formed using the same procedure as for a prime divisor, given below, with the caveat that the manipulations involved may not introduce any factor which is present in the divisor. For instance, one can not make a rule for 14 that involves multiplying the equation by 7. This is not an issue for prime divisors because they have no smaller factors.
Prime divisors
The goal is to find a multiple of the divisor which is close to a round number, and then manipulate the representation of the dividend to produce that number, as shown in the proofs section below. Using 17 as an example, we might find 3x17 = 51, and 6x17 = 102. Both these numbers produce rules in the table above, one using 50y + 5z, and the other using 100y + z.
Notable examples
The following table provides rules for a few more notable divisors:
| Divisor | Divisibility Condition | Examples |
|---|---|---|
| 25 | The number formed by the last two digits is divisible by 25. | 134,250: 50 is divisible by 25. |
| 27 | Since 37x27=999; the multiplier is one, taking three digits at-a-time. Sum the digits in blocks of three from right to left. | 2,644,272: 2 + 644 + 272 = 918. |
| Take the difference of the number with the last (units) digit removed and 8 times the last digit. | 621: 62 − (1×8) = 54. | |
| 32 | ||
| If the ten thousands digit is odd, examine the number formed by the last four digits plus 16. | 254,176: 4176+16 = 4192. | |
| Sum the number with the last two digits removed, times 4, plus the last two digits. | 1,312: (13x4) + 12 = 64. | |
| 33 | Sum the digits in blocks of two from right to left. Since 33x3=99; round up to 100; drop the two zeros; the multiplier is one. Sum each product, taking two digits at-a-time going leftward. | 627: 6 + 27 = 33. |
| 37 | Sum the digits in blocks of three from right to left. Since 37x27=999; round up to 1000; drop the three zeros; the multiplier is one, taking three digits at-a-time. Add these products, going from right to left. If the result is divisible by 37, then the number is divisible by 37. | 2,651,272: 2 + 651 + 272 = 925. 925/37=25, yes, divisible. |
| Difference the number with the last digit removed with 11 times the last digit. | 925: 92 − (5x11) = 37. | |
| 41 | Since 41x9=369, the multiplier is 37 taking one digit-at-a-time.
Since 41x39=1599, the multiplier is 16, taking two digits-at-a-time. Since 41x439=17999, the multiplier is 18, taking three digits-at-a-time. Since 41x2439=99999, the multiplier is 1, taking five digits at-a-time. Multiply the units digit by the multiplier and add to the next digit (group) to the left. Continue leftward processing that product-sum and adding the next digit (group). If the final value is a multiple of 41, then yes, the number is divisible by 41. |
For a multiplier of 16: 2,30,01: 01x16=16. 16+30=46. 46x16=736. 736+2=738. 738/41=18, yes. |
| 43 | Since 43x3=129, the multiplier is 13, taking one digit-at-a time. Multiply the units digit by the multiplier and add to the next digit (group) to the left. Continue leftward processing that product-sum and adding the next digit (group).
Since 43x93=3999, the multiplier is 4, taking three digits-at-a-time. If the final value is a multiple of 43, then yes, the number is divisible by 43. |
36,249: 4x249=996. 996+36=1032. 1032/43=24. Yes, divisible. |
| 47 | Since 47x7=329, the multiplier is 33, taking one digit-at-a-time. Since 47x17=799, the multiplier is 8, taking two digits-at-a-time. Since 47x617=28999, the multiplier is 29, taking three digits-at-a-time. Multiply the units digit by the multiplier and add to the next digit (group) to the left. Continue leftward processing that product-sum and adding the next digit (group). | 1,64,29,79: 8x79+29 = 661. 8x61+6+64 = 558. 8x58+5+1 = 470. Yes, divisible. |
| 49 | Sum the number with the last digit removed with 5 times the last digit. | 1,127: 112+(7×5)=147.
147: 14 + (7x5) = 49 Yes, divisible. |
Many of the simpler rules can be produced using only algebraic manipulation, creating binomials and rearranging them. By writing a number as the sum of each digit times a power of 10 each digit's power can be manipulated individually.
Case where all digits are summed
This method works for divisors that are factors of (base - 1).
Using 3 as an example, 3 divides 9 = 10 − 1. That means
(see modular arithmetic). The same for all the higher powers of 10:
They are all congruent to 1 modulo 3. Since two things that are congruent in modulo 3 are either both divisible by 3 or both not, we can interchange values that are congruent in modulo 3. So, a number such as the following, we can replace all the powers of 10 by 1:
which is exactly the sum of the digits.
Case where alternating digits are summed, then the difference is taken between them
This method works for divisors that are factors of (base + 1).
Using 11 as an example, 11 divides 11 = 10 + 1. That means
. For the higher powers of 10, they are congruent to 1 for even powers and congruent to -1 for odd powers:
Like the previous case, we can substitute powers of 10 with congruent values:
which is difference between the sum of digits at odd positions and the sum of digits at even positions.
Case where only the last digit(s) matter
This applies to divisors that are a factor of a power of the base. This is because sufficiently high powers of the base are multiples of the divisor, and can be eliminated.
For example, in base 10, the factors of 101 include 2, 5, and 10. Therefore, divisibility by 2, 5, and 10 only depend on whether the last 1 digit is divisible by those divisors. The factors of 102 include 4 and 25, and divisibility by those only depend on the last 2 digits.
Case where only the last digit(s) are removed
Most numbers do not divide 9 or 10 evenly, but do divide a higher power of 10n or 10n − 1. In this case the number is still written in powers of 10, but not fully expanded.
For example, 7 does not divide 9 or 10, but does divide 98, which is close to 100. Thus, proceed from
where in this case a is any integer, and b can range from 0 to 99. Next,
and again expanding
,
and after eliminating the known multiple of 7, the result is
,
which is the rule "double the number formed by all but the last two digits, then add the last two digits".
Case where the last digit(s) must be multiplied by a factor
The representation of the number may also be multiplied by any other factor not present in the divisor without changing its divisibility. After observing that 7 divides 21, we can perform the following:
,
after multiplying by 2, becomes
,
and then
.
Eliminating the 21 gives
,
and multiplying by −1 gives
.
Either of the last two rules may be used, depending on which is easier to perform. They correspond to the rule "difference the number with the last digit removed, with twice the last digit".
This section will illustrate the basic method; all the rules can be derived following the same procedure. The following requires a basic grounding in modular arithmetic; the proofs rest on the basic fact that a divides b if and only if b ≡ 0 (mod a).
For 2n or 5n:
Only the last n digits need to be checked.
Representing x as
,
and the divisibility of x is the same as that of z.
For 7:
Since 1000 ≡ −1 (mod 7) we can do the following:
Representing x as
,
Or using 20 ≡ −1 (mod 7) with x as
, we can multiply both sides of
by two and then
which must also be 0 if 7 divides x.
- Divisor
- Table of divisors — A table of prime and non-prime divisors for 1–1000
- Table of prime factors — For determining prime factors
- Integer factorization — for more sophisticated techniques
- ^ Su, Francis E.. "Divisibility by Seven" Mudd Math Fun Facts. Retrieved on December 12, 2006.
- ^ Page 274, Vedic Mathematics: Sixteen Simple Mathematical Formulae, by Swami Sankaracarya, published by Motilal Banarsidass, Varanasi, India, 1965, Delhi, 1978. 367 pages.








