Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Divisibility rule
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Divisibility rules for numbers 1β30 == 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. In some cases the process can be iterated until the divisibility is obvious; for others (such as examining the last ''n'' digits) the result must be examined by other means. 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. To test the divisibility of a number by a power of 2 or a power of 5 (2<sup>''n''</sup> or 5<sup>''n''</sup>, in which ''n'' is a positive integer), one only need to look at the last ''n'' digits of that number. To test divisibility by any number expressed as the product of prime factors <math>p_1^n p_2^m p_3^q</math>, we can separately test for divisibility by each prime to its appropriate power. For example, testing divisibility by 24 {{nobr|1=(24 = 8 Γ 3 = 2<sup>3</sup> Γ 3)}} is equivalent to testing divisibility by 8 (2<sup>3</sup>) and 3 simultaneously, thus we need only show divisibility by 8 and by 3 to prove divisibility by 24. <!-- Note: the "id" attributes allow direct linking to this table as e.g. [[Divisibility rule#7]]. --> {{Table TOC|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30}} {| class="wikitable" |+ ! Divisor ! Divisibility condition ! Examples |- |id=1| '''[[1 (number)|1]]''' | No specific condition. Any integer is divisible by 1. | 2 is divisible by 1. |- |id=2| '''[[2 (number)|2]]''' | The last digit is even (0, 2, 4, 6, or 8).<ref name="Pascal's-criterion">This follows from Pascal's criterion. See KisaΔanin (1998), [{{Google books|plainurl=y|id=BFtOuh5xGOwC|page=101|text=A number is divisible by}} p. 100β101]</ref><ref name="last-m-digits">A number is divisible by 2<sup>''m''</sup>, 5<sup>''m''</sup> or 10<sup>''m''</sup> if and only if the number formed by the last ''m'' digits is divisible by that number. See Richmond & Richmond (2009), [{{Google books|plainurl=y|id=HucyKYx0_WwC|page=105|text=formed by the last}} p. 105]</ref> | 1,294: 4 is even. |- |id=3 rowspan=3| '''[[3 (number)|3]]''' | The sum of the digits must be divisible by 3. (Works because 9 is divisible by 3.)<ref name="Pascal's-criterion"/><ref name="apostol-1976">Apostol (1976), [{{Google books|plainurl=y|id=Il64dZELHEIC|page=108|text=sum of its digits}} p. 108]</ref><ref name="Richmond-Richmond-2009">Richmond & Richmond (2009), [{{Google books|plainurl=y|id=HucyKYx0_WwC|page=102|text=divisible by}} Section 3.4 (Divisibility Tests), p. 102β108]</ref> | 405 β 4 + 0 + 5 = 9 and 636 β 6 + 3 + 6 = 15 which both are clearly divisible by 3,<br/>16,499,205,854,376 β 1 + 6 + 4 + 9 + 9 + 2 + 0 + 5 + 8 + 5 + 4 + 3 + 7 + 6 sums to 69 β 6 + 9 = 15, which is divisible by 3. |- | Subtract the quantity of the digits 2, 5, and 8 in the number from the quantity of the digits 1, 4, and 7 in the number. The result must be divisible by 3. | Using the example above: 16,499,205,854,376 has four of the digits 1, 4 and 7 and four of the digits 2, 5 and 8; since 4 β 4 = 0 is a multiple of 3, the number 16,499,205,854,376 is divisible by 3. |- | Subtracting twice the last digit from the rest gives a multiple of 3. (Works because 21 is divisible by 3.) | 405: 40 β 5 Γ 2 = 40 β 10 = 30 = 3 Γ 10. |- |id=4 rowspan=3| '''[[4 (number)|4]]''' | The last two digits form a number that is divisible by 4.<ref name="Pascal's-criterion"/><ref name="last-m-digits"/> | 40,832: 32 is divisible by 4. |- | If the tens digit is even, the ones digit must be 0, 4, or 8.<br/>If the tens digit is odd, the ones digit must be 2 or 6. | 40,832: 3 is odd, and the last digit is 2. |- | The sum of the ones digit and double the tens digit is divisible by 4. | 40,832: 2 Γ 3 + 2 = 8, which is divisible by 4. |- |id=5| '''[[5 (number)|5]]''' | The last digit is 0 or 5.<ref name="Pascal's-criterion"/><ref name="last-m-digits"/> | 495: the last digit is 5. |- |id=6 rowspan=2| '''[[6 (number)|6]]''' | It is divisible by 2 and by 3.<ref name="product-of-coprimes">Richmond & Richmond (2009), [{{Google books|plainurl=y|id=HucyKYx0_WwC|page=102|text=divisible by the product}} Section 3.4 (Divisibility Tests), Theorem 3.4.3, p. 107]</ref> | 1,458: 1 + 4 + 5 + 8 = 18, so it is divisible by 3 and the last digit is even, hence the number is divisible by 6. |- | Sum the ones digit, 4 times the 10s digit, 4 times the 100s digit, 4 times the 1000s digit, etc. If the result is divisible by 6, so is the original number. (Works because <math>10^n = 4 \pmod{6}</math> for <math>n > 1</math>.) | 1,458: (4 Γ 1) + (4 Γ 4) + (4 Γ 5) + 8 = 4 + 16 + 20 + 8 = 48. |- |id=7 rowspan=8| '''[[7 (number)|7]]''' | Forming an [[alternating sum]] of blocks of three from right to left gives a multiple of 7.<ref name="Richmond-Richmond-2009"/><ref name="alternating-sum-of-blocks-of-three">KisaΔanin (1998), [{{Google books|plainurl=y|id=BFtOuh5xGOwC|page=101|text=third criterion for 11}} p. 101]</ref> | 1,369,851: 851 β 369 + 1 = 483 = 7 Γ 69. |- | Adding 5 times the last digit to the rest gives a multiple of 7. (Works because (50 β 1) is divisible by 7.) | 483: 48 + (3 Γ 5) = 63 = 7 Γ 9. |- | Subtracting twice the last digit from the rest gives a multiple of 7. (Works because (20 + 1) is divisible by 7.) | 483: 48 β (3 Γ 2) = 42 = 7 Γ 6. |- | Subtracting 9 times the last digit from the rest gives a multiple of 7. (Works because (90 + 1) is divisible by 7.) | 483: 48 β (3 Γ 9) = 21 = 7 Γ 3. |- | Adding 3 times the first digit to the next and then writing the rest gives a multiple of 7. (This works because 10''a'' + ''b'' β 7''a'' = 3''a'' + ''b''; the last number has the same remainder as 10''a'' + ''b''.) | 483: 4 Γ 3 + 8 = 20,<br/> 203: 2 Γ 3 + 0 = 6,<br/> 63: 6 Γ 3 + 3 = 21. |- | Adding the last two digits to twice the rest gives a multiple of 7. (Works because (100 β 2) is divisible by 7.) | 483,595: 95 + (2 Γ 4835) = 9765: 65 + (2 Γ 97) = 259: 59 + (2 Γ 2) = 63. |- | Multiply each digit (from right to left) by the digit in the corresponding position in this pattern (from left to right): 1, 3, 2, β1, β3, β2 (repeating for digits beyond the hundred-thousands place). Adding the results gives a multiple of 7. | 483,595: (4 Γ (β2)) + (8 Γ (β3)) + (3 Γ (β1)) + (5 Γ 2) + (9 Γ 3) + (5 Γ 1) = 7. |- | Compute the remainder of each digit pair (from right to left) when divided by 7. Multiply the rightmost remainder by 1, the next to the left by 2 and the next by 4, repeating the pattern for digit pairs beyond the hundred-thousands place. Adding the results gives a multiple of 7. | 194,536: <nowiki>19|45|36</nowiki>; (5 Γ 4) + (3 Γ 2) + (1 Γ 1) = 27, so it is not divisible by 7,<br/><!-- --> 204,540: <nowiki>20|45|40</nowiki>; (6 Γ 4) + (3 Γ 2) + (5 Γ 1) = 35, so it is divisible by 7. |- |id=8 rowspan=5| '''[[8 (number)|8]]''' | If the hundreds digit is even, the number formed by the last two digits must be divisible by 8. | 624: 24. |- | If the hundreds digit is odd, the number obtained by the last two digits must be 4 times an odd number. | 352: 52 = 4 Γ 13. |- | Add the last digit to twice the rest. The result must be divisible by 8. | 56: (5 Γ 2) + 6 = 16. |- | The last three digits are divisible by 8.<ref name="Pascal's-criterion"/><ref name="last-m-digits"/> | 34,152: examine divisibility of just 152: 19 Γ 8. |- | The sum of the ones digit, double the tens digit, and four times the hundreds digit is divisible by 8. | 34,152: 4 Γ 1 + 5 Γ 2 + 2 = 16. |- |id=9 rowspan=2| '''[[9 (number)|9]]''' | The sum of the digits must be divisible by 9.<ref name="Pascal's-criterion"/><ref name="apostol-1976"/><ref name="Richmond-Richmond-2009"/> | 2,880: 2 + 8 + 8 + 0 = 18: 1 + 8 = 9. |- | Subtracting 8 times the last digit from the rest gives a multiple of 9. (Works because 81 is divisible by 9.) | 2,880: 288 β 0 Γ 8 = 288 β 0 = 288 = 9 Γ 32. |- |id=10 rowspan=2| '''[[10 (number)|10]]''' | The last digit is 0.<ref name="last-m-digits" /> | 130: the ones digit is 0. |- | It is divisible by 2 and by 5. | 130: it is divisible by 2 and by 5. |- |id=11 rowspan=6| '''[[11 (number)|11]]''' | Form the alternating sum of the digits, or equivalently sum(odd) β sum(even). The result must be divisible by 11.<ref name="Pascal's-criterion"/><ref name="Richmond-Richmond-2009"/> | 918,082: 9 β 1 + 8 β 0 + 8 β 2 = 22 = 2 Γ 11. |- | Add the digits in blocks of two from right to left. The result must be divisible by 11.<ref name="Pascal's-criterion"/> | 627: 6 + 27 = 33 = 3 Γ 11. |- | Subtract the last digit from the rest. The result must be divisible by 11. | 627: 62 β 7 = 55 = 5 Γ 11. |- | Add 10 times the last digit to the rest. The result must be divisible by 11. (Works because 99 is divisible by 11.) | 627: 62 + 70 = 132: 13 + 20 = 33 = 3 Γ 11. |- | If the number of digits is even, add the first and subtract the last digit from the rest. The result must be divisible by 11. | 918,082: the number of digits is even (6) β 1808 + 9 β 2 = 1815: 81 + 1 β 5 = 77 = 7 Γ 11. |- | If the number of digits is odd, subtract the first and last digit from the rest. The result must be divisible by 11. | 14,179: the number of digits is odd (5) β 417 β 1 β 9 = 407: 0 β 4 β 7 = β11 = β1 Γ 11. |- |id=12 rowspan=2| '''[[12 (number)|12]]''' | It is divisible by 3 and by 4.<ref name="product-of-coprimes"/> | 324: it is divisible by 3 and by 4. |- | Subtract the last digit from twice the rest. The result must be divisible by 12. | 324: 32 Γ 2 β 4 = 60 = 5 Γ 12. |- |id=13 rowspan=4| '''[[13 (number)|13]]''' | Form the [[alternating sum]] of blocks of three from right to left. The result must be divisible by 13.<ref name="alternating-sum-of-blocks-of-three"/> | 2,911,272: 272 β 911 + 2 = β637. |- | Add 4 times the last digit to the rest. The result must be divisible by 13. (Works because 39 is divisible by 13.) | 637: 63 + 7 Γ 4 = 91, 9 + 1 Γ 4 = 13. |- | Subtract the last two digits from four times the rest. The result must be divisible by 13. | 923: 9 Γ 4 β 23 = 13. |- | Subtract 9 times the last digit from the rest. The result must be divisible by 13. (Works because 91 is divisible by 13.) | 637: 63 β 7 Γ 9 = 0. |- |id=14 rowspan=2| '''[[14 (number)|14]]''' | It is divisible by 2 and by 7.<ref name="product-of-coprimes"/> | 224: it is divisible by 2 and by 7. |- | Add the last two digits to twice the rest. The result must be divisible by 14. | 364: 3 Γ 2 + 64 = 70,<br />1,764: 17 Γ 2 + 64 = 98. |- |id=15| '''[[15 (number)|15]]''' | It is divisible by 3 and by 5.<ref name="product-of-coprimes"/> | 390: it is divisible by 3 and by 5. |- |id=16 rowspan=4| '''[[16 (number)|16]]''' |style="border-bottom: hidden;"| If the thousands digit is even, the number formed by the last three digits must be divisible by 16. |style="border-bottom: hidden;"| 254,176: 176. |- | If the thousands digit is odd, the number formed by the last three digits must be 8 times an odd number. | 3408: 408 = 8 Γ 51. |- | Add the last two digits to four times the rest. The result must be divisible by 16. | 176: 1 Γ 4 + 76 = 80,<br/> 1,168: 11 Γ 4 + 68 = 112. |- | The last four digits must be divisible by 16.<ref name="Pascal's-criterion"/><ref name="last-m-digits"/> | 157,648: 7,648 = 478 Γ 16. |- |id=17 rowspan=4| '''[[17 (number)|17]]''' | Subtract 5 times the last digit from the rest. (Works because 51 is divisible by 17.) | 221: 22 β 1 Γ 5 = 17. |- | Add 12 times the last digit to the rest. (Works because 119 is divisible by 17.) | 221: 22 + 1 Γ 12 = 22 + 12 = 34 = 17 Γ 2. |- | Subtract the last two digits from two times the rest. (Works because 102 is divisible by 17.) | 4,675: 46 Γ 2 β 75 = 17. |- | Add twice the last digit to 3 times the rest. Drop trailing zeroes. (Works because (10''a'' + ''b'') Γ 2 β 17''a'' = 3''a'' + 2''b''; since 17 is a prime and 2 is coprime with 17, 3''a'' + 2''b'' is divisible by 17 if and only if 10''a'' + ''b'' is.) | 4,675: 467 Γ 3 + 5 Γ 2 = 1,411: 141 Γ 3 + 1 Γ 2 = 425: 42 Γ 3 + 5 Γ 2 = 136: 13 Γ 3 + 6 Γ 2 = 51,<br /> 238: 23 Γ 3 + 8 Γ 2 = 85. |- |id=18| '''[[18 (number)|18]]''' | It is divisible by 2 and by 9.<ref name="product-of-coprimes"/> | 342: it is divisible by 2 and by 9. |- |id=19 rowspan=2| '''[[19 (number)|19]]''' | Add twice the last digit to the rest. (Works because (10''a'' + ''b'') Γ 2 β 19''a'' = ''a'' + 2''b''; since 19 is a prime and 2 is coprime with 19, ''a'' + 2''b'' is divisible by 19 if and only if 10''a'' + ''b'' is.) | 437: 43 + 7 Γ 2 = 57. |- | Add 4 times the last two digits to the rest. (Works because 399 is divisible by 19.) | 6,935: 69 + 35 Γ 4 = 209. |- |id=20 rowspan=3| '''[[20 (number)|20]]''' | It is divisible by 10, and the tens digit is even. | 360: is divisible by 10, and 6 is even. |- | The last two digits are 00, 20, 40, 60 or 80.<ref name="last-m-digits"/> | 480: 80 |- | It is divisible by 4 and by 5. | 480: it is divisible by 4 and by 5. |- |id=21 rowspan=3|'''[[21 (number)|21]]''' | Subtracting twice the last digit from the rest gives a multiple of 21. (Works because (10''a'' + ''b'') Γ 2 β 21''a'' = β''a'' + 2''b''; the last number has the same remainder as 10''a'' + ''b''.) | 168: 16 β 8 Γ 2 = 0. |- | Suming 19 times the last digit to the rest gives a multiple of 21. (Works because 189 is divisible by 21.) | 441: 44 + 1 Γ 19 = 44 + 19 = 63 = 21 Γ 3. |- | It is divisible by 3 and by 7.<ref name="product-of-coprimes"/> | 231: it is divisible by 3 and by 7. |- |id=22| '''[[22 (number)|22]]''' | It is divisible by 2 and by 11.<ref name="product-of-coprimes"/> | 352: it is divisible by 2 and by 11. |- |id=23 rowspan=4| '''[[23 (number)|23]]''' | Add 7 times the last digit to the rest. (Works because 69 is divisible by 23.) | 3,128: 312 + 8 Γ 7 = 368: 36 + 8 Γ 7 = 92. |- | Add 3 times the last two digits to the rest. (Works because 299 is divisible by 23.) | 1,725: 17 + 25 Γ 3 = 92. |- | Subtract 16 times the last digit from the rest. (Works because 161 is divisible by 23.) | 1,012: 101 β 2 Γ 16 = 101 β 32 = 69 = 23 Γ 3. |- | Subtract twice the last three digits from the rest. (Works because 2,001 is divisible by 23.) | 2,068,965: 2,068 β 965 Γ 2 = 138. |- |id=24| '''[[24 (number)|24]]''' | It is divisible by 3 and by 8.<ref name="product-of-coprimes"/> | 552: it is divisible by 3 and by 8. |- |id=25| '''[[25 (number)|25]]''' | The last two digits are 00, 25, 50 or 75. | 134,250: 50 is divisible by 25. |- |id=26 rowspan=2| '''[[26 (number)|26]]''' | It is divisible by 2 and by 13.<ref name="product-of-coprimes"/> | 156: it is divisible by 2 and by 13. |- | Subtracting 5 times the last digit from twice the rest of the number gives a multiple of 26. (Works because 52 is divisible by 26.) | 1,248 : (124 Γ 2) β (8 Γ 5) = 208 = 26 Γ 8. |- |id=27 rowspan=4|'''[[27 (number)|27]]''' | Sum the digits in blocks of three from right to left. (Works because 999 is divisible by 27.) | 2,644,272: 2 + 644 + 272 = 918. |- | Subtract 8 times the last digit from the rest. (Works because 81 is divisible by 27.) | 621: 62 β 1 Γ 8 = 54. |- | Sum 19 times the last digit from the rest. (Works because 189 is divisible by 27.) | 1,026: 102 + 6 x 19 = 102 + 114 = 216 = 27 Γ 8. |- | Subtract the last two digits from 8 times the rest. (Works because 108 is divisible by 27.) | 6,507: 65 Γ 8 β 7 = 520 β 7 = 513 = 27 Γ 19. |- |id=28| '''[[28 (number)|28]]''' | It is divisible by 4 and by 7.<ref name="product-of-coprimes"/> | 140: it is divisible by 4 and by 7. |- |id=29 rowspan=4| '''[[29 (number)|29]]''' | Add three times the last digit to the rest. (Works because (10''a'' + ''b'') Γ 3 β 29''a'' = ''a'' + 3''b''; the last number has the same remainder as 10''a'' + ''b''.) | 348: 34 + 8 Γ 3 = 58. |- | Add 9 times the last two digits to the rest. (Works because 899 is divisible by 29.) | 5,510: 55 + 10 Γ 9 = 145 = 5 Γ 29. |- | Subtract 26 times the last digit from the rest. (Works because 261 is divisible by 29.) | 1,015: 101 β 5 Γ 26 = 101 β 130 = β29 = 29 Γ β1 |- | Subtract twice the last three digits from the rest. (Works because 2,001 is divisible by 29.) | 2,086,956: 2,086 β 956 Γ 2 = 174. |- |id=30 rowspan=4| '''[[30 (number)|30]]''' | It is divisible by 3 and by 10.<ref name="product-of-coprimes"/> | 270: it is divisible by 3 and by 10. |- | It is divisible by 2, by 3 and by 5. | 270: it is divisible by 2, by 3 and by 5. |- | It is divisible by 2 and by 15. | 270: it is divisible by 2 and by 15. |- | It is divisible by 5 and by 6. | 270: it is divisible by 5 and by 6. |}
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)