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 created for any base, only rules for decimal are given here.

Contents

[edit] 1 through 20

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 after applying it once, the rule should be applied again to the result.

Divisor Divisibility Condition Examples
1 Automatic. Any integer is divisible by 1.
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. For large numbers, digits may be summed iteratively. 405: 4 + 0 + 5 = 9, which clearly is divisible by 3. 16,499,205,854,376 sums to 69, 6 + 9 = 15, 1 + 5 = 6, which is clearly divisible by 3.
4 Add the ones digit to twice the tens digit. (All digits to the left of the tens digit can be ignored.) 5,096: 6 + (2 × 9) = 24
The last two digits divisible by 4. 40832: 32 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.
Add the last digit to four times the sum of all other digits. 198: (1 + 9) × 4 + 8 = 48
7 The number obtained from these examples must be divisible by 7, as follows:
Form the alternating sum of blocks of three from right to left. 1,369,851: 851 - 369 + 1 = 483 = 7 × 69
Subtract 2 times the last digit from the rest. 483: 48 - (3 × 2) = 42 = 7 x 6.
Or, add 5 times the last digit to the rest. 483: 48 + (3 × 5) = 63 = 7 x 9.
8 The number obtained from these examples must be divisible by 8, as follows:
If the hundreds digit is even, examine the number formed by the last two digits. 624: 24.
If the hundreds digit is odd, examine the number obtained by the last two digits plus 4. 352: 52 + 4 = 56.
Add the last digit to twice the rest. 56: (5 × 2) + 6 = 16.
9 The sum of the digits is divisible by 9. For larger numbers, digits may be summed iteratively. Result at the final iteration will be 9. 2,880: 2 + 8 + 8 + 0 = 18: 1 + 8 = 9.
10 The last digit is 0. 130: the last digit is 0.
11 The number obtained from these examples must be divisible by 11, as follows:
Form the alternating sum of the digits. 918,082: 9 - 1 + 8 - 0 + 8 - 2 = 22.
Add the digits in blocks of two from right to left. 627: 6 + 27 = 33.
Subtract the last digit from the rest. 627: 62 - 7 = 55.
12 It is divisible by 3 and by 4. 324: it is divisible by 3 and by 4.
Subtract the last digit from twice the rest. 324: (32 × 2) − 4 = 60.
13 The number obtained from these examples must be divisible by 13, as follows:
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 4 times the last digit to the rest. 637: 63 + (7 × 4) = 91, 9 + (1 × 4) = 13.
14 It is divisible by 2 and by 7. 224: it is divisible by 2 and by 7.
Add the last two digits to twice the rest. The answer must be divisible by 7. 364: (3 × 2) + 64 = 70.
15 It is divisible by 3 and by 5. 390: it is divisible by 3 and by 5.
16 The number obtained from these examples must be divisible by 16, as follows:
If the thousands digit is even, examine the number formed by the last three digits. 254,176: 176.
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: (1 × 4) + 76 = 80.
17 Subtract 5 times the last digit from the rest. 221: 22 - (1 × 5) = 17.
18 It is divisible by 2 and by 9. 342: it is divisible by 2 and by 9.
19 Add twice the last digit to the rest. 437: 43 + (7 × 2) = 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.

[edit] Step-by-step examples of 2 through 7

[edit] Divisibility by 2

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 original number is divisible by 2.

Ex.

  1. 376 (The original number)
  2. 37 6 (Take the last digit)
  3. 6 ÷ 2 = 3 (Check to see if the last digit is divisible by 2)
  4. 376 ÷ 2 = 188 (If the last digit is divisible by 2, then the whole number is divisible by 2)


Example: Is 6 divisable by 2?

Yes, because 2 is a factor of 6.

[edit] Divisibility by 3

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 original number is divisible by 3.

Ex.

  1. 492 (The original number)
  2. 4 + 9 + 2 = 15 (Add each individual digit together)
  3. 15 ÷ 3 = 5 (Check to see if the number received is divisible by 3)
  4. 492 ÷ 3 = 164 (If the number obtained by using the rule is divisible by 3, then the whole number is divisible by 3)

[edit] Divisibility by 4

The basic rule for divisibility by 4 is that if the number formed by the last two digits in a number is divisible by 4, the original number is divisible by 4; this is because 100 is divisible by 4 and so adding hundreds, thousands, etc. is simply adding another number that is divisible by 4. 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 5,096) and note the last two digits in the number, discarding any other digits. Then take that number (96), double the tens digit (2 × 9 = 18), and add the ones digit (18 + 6 = 24). Since 24 is divisible by 4, so is the original two-digit number, 96 — and, therefore, so is the original number, 5,096. (If it's not clear that 24 is divisible by 4, repeat the process: 2 × 2 = 4, and 4 + 4 = 8, which 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 original number is divisible by 4. In addition, the result of this test is the same as the original number divided by 4.

Ex.
General Rule

  1. 2092 (The original number)
  2. 20 92 (Take the last two digits of the number, discarding any other digits)
  3. 92 ÷ 4 = 23 (Check to see if the number is divisible by 4)
  4. 2092 ÷ 4 = 523 (If the number that is obtained is divisible by 4, then the original number is divisible by 4)

Alternative Ex.

  1. 1720 (The original number)
  2. 1720 ÷ 2 = 860 (Divide the original number by 2)
  3. 860 ÷ 2 = 430 (Check to see if the result is divisible by 2)
  4. 1720 ÷ 4 = 430 (If the result is divisible by 2, then the original number is divisible by 4)

[edit] Divisibility by 5

Divisibility by 5 is easily determined by checking the last digit in the number (475), and seeing if it is either 0 or 5. If the last number is either 0 or 5, 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 remaining 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

  1. 110 (The original number)
  2. 11 0 (Take the last digit of the number, and check if it is 0 or 5)
  3. 11 0 (If it is 0, take the remaining digits, discarding the last)
  4. 11 × 2 = 22 (Multiply the result by 2)
  5. 110 ÷ 5 = 22 (The result is the same as the original number divided by 5)

If The Last Digit is 5

  1. 85 (The original number)
  2. 8 5 (Take the last digit of the number, and check if it is 0 or 5)
  3. 8 5 (If it is 5, take the remaining digits, discarding the last)
  4. 8 × 2 = 16 (Multiply the result by 2)
  5. 16 + 1 = 17 (Add 1 to the result)
  6. 85 ÷ 5 = 17 (The result is the same as the original number divided by 5)

[edit] Divisibility by 6

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. This is the best test to use.

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

  1. 324 (The original number)
  2. 324 ÷ 3 = 108 (Check to see if the original number is divisible by 3)
  3. 324 ÷ 2 = 162 OR 108 ÷ 2 = 54 (Check to see if either the original number or the result of the previous equation is divisible by 2)
  4. 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)


Example: IS 13 divisable by 5? No , because the # doesn't end in a 0 or a 5.

[edit] Divisibility by 7

Divisibility by 7 can be tested by a method which is recursive. Writing a number in the form 10x+y, it is divisible by 7 if and only if x-2y is divisible by 7. This rule says: 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 x 1). Continue to do this until a small number (below 20 in absolute value) is obtained. Then the original number is divisible by 7 if and only if the number obtained using this procedure is divisible by 7 (371 → 37-2=35 → 3-10=-7, hence 371 is divisible by 7 since -7 is).

A much more complicated for testing divisibility by 7 uses the fact that 100 ≡ 1, 101 ≡ 3, 10² ≡ 2, 10³ ≡ 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 (1x1 + 7x3 + 3x2 = 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]

First Method Example
1050 → 105-0=105 → 10-10=0. ANSWER: 1050 is divisible by 7.

Second Method Example
1050 → 0501 (reverse) → 0x1 + 5x3 + 0x2 + 1x6 = 0 + 15 + 0 + 6 = 21 (multiply and add). 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 solution that can determine if most integers are divisible by seven in three steps or less. This method could be useful in a mathematics competition such as MATHCOUNTS, where time is a factor to determine the solution without a calculator in the Sprint Round.

Step A: If the integer is 1,000 or less, 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 (and vice versa). For example:

112 -> 11 - (2*2) = 11 - 4  =  7  YES
98  -> 9  - (8*2) = 9  - 16 = -7  YES
634 -> 63 - (4*2) = 63 - 8  = 55  NO

Because 1,001 is divisible by seven, an interesting pattern develops for repeating 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. For example:

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
01 01 01 = 10,101 / 7 = 1,443 
10 10 10 = 101,010 / 7 = 14,430
111,111 / 7 = 15,873
222,222 / 7 = 31,746
999,999 / 7 = 142,857
576,576 / 7 = 82,368

For all of the above examples, subtracting the first thee digits from the last three results in a multiple of seven. Notice that leading zeros are permitted to form a 6-digit pattern.

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 (leading zeros are allowed and can help you visualize the pattern). If the positive difference is less than 1,000, apply Step A. This can be done by subtracting the first three digits from the last three digits. For example:

341,355 - 341,341 = 14 -> 1 - (4*2) = 1 - 8 = -7     YES
 67,326 - 067,067 = 259 -> 25 - (9*2) = 25 - 18 = 7  YES

The fact that 999,999 is a multiple of 7 can be used for determining divisibility of integers larger than one million by reducing the integer to a 6-digit number that can be determined using Step B. This can be done easily by adding the digits left of the first six to the last six and follow with Step A.

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. For example:

22,862,420 - (999,999 * 22) = 22,862,420 - 21,999,978 -> 862,420 + 22 = 862,442
   862,442 -> 862 - 442 (Step B) = 420 -> 42 - (0*2) (Step A) = 42  YES

This allows adding and subtracting alternating sets of three digits to determine divisibility by seven. Understanding these patterns allows you to quickly calculate divisibilty of seven as seen in the following examples:

Pohlman-Mass Method of Divisibility of Seven Examples:

Is 98 divisible by seven?
98  -> 9  - (8*2) = 9  - 16 = -7  YES  (Step A)
Is 634 divisible by seven?
634 -> 63 - (4*2) = 63 - 8  = 55  NO  (Step A)
Is 355,341 divisible by seven?
355,341 - 341,341 = 14,000 (Step B) -> 014 - 000 (Step B) -> 14 = 1 - (4*2) (Step A) = 1 - 8 = -7  YES
Is 42,341,530 divisible by seven?
42,341,530 -> 341,530 + 42 = 341,572 (Step C)
341,572 - 341,341 = 231 (Step B)
231 -> 23 - (1*2) = 23 - 2 = 21  YES (Step A)
 Using quick alternating additions and subtractions:
 42,341,530 -> 530 - 341 = 189 + 42 = 231 -> 23 - (1*2) = 21  YES

Divisibility by Seven Using Remainders

Another divisibility plus remainder test of 7 has it that there is pattern (1, 3, 2, -1, -3, -2, cycle goes on.) Multiply the right most digit of the number with the left most number in the sequence shown above and the second right most digit to the second left most digit of the number in the sequence. You can then continue the pattern.

Example: What is the remainder when 321 is divided by 7? Ans: 1 x 1 + 2 x 3 + 3 x 2 = 13 mod 7 = 6
Remainder = 6

Example: What is the remainder when 1234567 is divided by 7? Answer: 7 x 1 + 6 x 3 + 5 x 2 - 4 x 1 - 3 x 3 - 2 x 2 + 1 x 1 = 19 mod 7 = 5
Remainder = 5

[edit] Divisibility by 13

13 (1, 10, -4, -1, -10, 4, cycle goes on.) Multiply the right most digit of the number with the left most number in the sequence shown above and the second right most digit to the second left most digit of the number in the sequence. The cycle goes on.

Example: What is the remainder when 321 is divided by 13?
Ans: 1 x 1 + 2 x 10 - 3 x 4 = 9

Remainder = 9

Example: What is the remainder when 1234567 is divided by 13?
Answer: 7 x 1 + 6 x 10 - 5 x 4 - 4 x 1 - 3 x 10 + 2 x 4 + 1 x 1 = 22 mod 13 = 9

Remainder = 9

[edit] Beyond 20

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, 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 an inverse to 10 modulo the prime (not 2 or 5) and use that as a multiplier to make the divisibility of the original number by that prime depend on the divisibility of the new (usually smaller) number by the same prime. Using 17 as an example, since 10 × (−5) = -50 = 1 mod 17, we get the rule for using y − 5x in the table above. In fact, this rule for prime divisors besides 2 and 5 is really a rule for divisibility by any integer relatively prime to 10 (including 21 and 27; see tables below). This is why the last divisibility condition in the tables above and below for any number relatively prime to 10 has the same kind of form (add or subtract some multiple of the last digit from the rest of the number).

Notable examples
The following table provides rules for a few more notable divisors:

Divisor Divisibility Condition Examples
21 Subtract twice the last digit from the rest.
23 Add 7 times the last digit to the rest.
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.
Subtract 8 times the last digit from the rest. 621: 62 − (1×8) = 54.
29 Add three times the last digit to the rest. 261: 1x3=3; 3+26= 29
31 Subtract three times the last digit from the rest.
32 The number formed by the last five digits is divisible by 32, as follows:
If the ten thousands digit is even, examine the number formed by the last four digits. 41,312: 1312.
If the ten thousands digit is odd, examine the number formed by the last four digits plus 16. 254,176: 4176+16 = 4192.
Add the last two digits to 4 times the rest. 1,312: (13x4) + 12 = 64.
33 Add 10 times the last digit to the rest. 627: 62 + 7 x 10 = 132, 13 + 2 x 10 = 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.
Subtract 11 times the last digit from the rest. 925: 92 − (5x11) = 37.
39 Add 4 times the last digit to the rest. 351: 1x4=4; 4+35=39
41 Subtract 4 times the last digit from the rest. 738: 73 - 8 x 4 = 41.
43 Add 13 times the last digit to the rest. 36,249: 3624 + 9 x 13 = 3741, 374 + 1 x 13 = 387, 38 + 7 x 13 = 129, 12 + 9 x 13 = 129 = 43 x 3.
47 Subtract 14 times the last digit from the rest. 1,642,979: 164297- 9 x 14 = 164171, 16417 - 14 = 16403, 1640 - 3 x 14 = 1598, 159 - 8 x 14 = 47.
49 Add 5 times the last digit to the rest. 1,127: 112+(7×5)=147.

147: 14 + (7x5) = 49 Yes, divisible.

51 Subtract 5 times the last digit to the rest.
59 Add 6 times the last digit to the rest. 295: 5x6=30; 30+29=59
61 Subtract 6 times the last digit from the rest.
69 Add 7 times the last digit to the rest. 345: 5x7=35; 35+34=69
71 Subtract 7 times the last digit from the rest.
79 Add 8 times the last digit to the rest. 711: 1x8=8; 8+71=79
81 Subtract 8 times the last digit from the rest.
89 Add 9 times the last digit to the rest. 801: 1x9=9; 80+9=89
91 Subtract 9 times the last digit from the rest.
989 Divide the number of thousands by 989. Multiply the remainder by 11 and add to last 3 digits. 21758: 21/989 Remainder = 21, 21 x 11 = 231; 758 + 231=989

[edit] Proofs

[edit] Proof using basic algebra

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 10 − 1 = 9.

Using 3 as an example, 3 divides 9 = 10 − 1. That means 10 \equiv 1 \pmod{3} (see modular arithmetic). The same for all the higher powers of 10: 10^n \equiv 1^n \equiv 1 \pmod{3} They are all congruent to 1 modulo 3. Since two things that are congruent modulo 3 are either both divisible by 3 or both not, we can interchange values that are congruent modulo 3. So, in a number such as the following, we can replace all the powers of 10 by 1:

100\cdot a + 10\cdot b + 1\cdot c \equiv (1)a + (1)b + (1)c \pmod{3}

which is exactly the sum of the digits.

Case where the alternating sum of digits is used

This method works for divisors that are factors of 10 + 1 = 11.

Using 11 as an example, 11 divides 11 = 10 + 1. That means 10 \equiv -1 \pmod{11}. For the higher powers of 10, they are congruent to 1 for even powers and congruent to -1 for odd powers:

10^n \equiv (-1)^n \equiv \begin{cases} 1, & \mbox{if }n\mbox{ is even} \\ -1, & \mbox{if }n\mbox{ is odd} \end{cases} \pmod{11}.

Like the previous case, we can substitute powers of 10 with congruent values:

1000\cdot a + 100\cdot b + 10\cdot c + 1\cdot d \equiv (-1)a + (1)b + (-1)c + (1)d \pmod{11}

which is also the 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 10. 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

100 \cdot a + b

where in this case a is any integer, and b can range from 0 to 99. Next,

(98+2) \cdot a + b

and again expanding

98 \cdot a + 2 \cdot a + b,

and after eliminating the known multiple of 7, the result is

2 \cdot a + b,

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) is multiplied by a factor

The representation of the number may also be multiplied by any number relatively prime to the divisor without changing its divisibility. After observing that 7 divides 21, we can perform the following:

10 \cdot a + b,

after multiplying by 2, this becomes

20 \cdot a + 2 \cdot b,

and then

(21 - 1) \cdot a + 2 \cdot b.

Eliminating the 21 gives

 -1 \cdot a + 2 \cdot b,

and multiplying by −1 gives

 a - 2 \cdot b.

Either of the last two rules may be used, depending on which is easier to perform. They correspond to the rule "subtract twice the last digit from the rest".

[edit] Proof using modular arithmetic

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; for divisibility other than by 2's and 5's the proofs rest on the basic fact that 10 mod m is invertible if 10 and m are relatively prime.

For 2n or 5n:

Only the last n digits need to be checked.

10^n = 2^n \cdot 5^n \equiv 0 \pmod{2^n \mathrm{\ or\ } 5^n}

Representing x as 10^n \cdot y + z,

x = 10^n \cdot y + z \equiv z \pmod{2^n \mathrm{\ or\ } 5^n}

and the divisibility of x is the same as that of z.

For 7:

Since 10 × 5  ≡  10 × (−2)  ≡ 1 (mod 7) we can do the following:

Representing x as 10 \cdot y + z,

-2x \equiv y -2z \pmod{7}, so x is divisible by 7 if and only if y - 2z is divisible by 7.

[edit] General divisibility rule

This rule is interesting due to its simplicity. The idea come from Murad A. AlDamen [3].

Let there be two numbers greater than 10: N = n1 + 10n2 and M = m1 + 10m2. If n2×m1 − n1×m2 is divisible by M, then N is divisible by M.

for example: Does 61 divide 3598207?

M = 1 + 10*6

N = 7 + 10×359820

359820×16×7 = 359778 The operation is repeated with N now equal to 359778:

35977×16×8 = 35929

3592×16×9 = 3538

353×16×8 = 305

30×16×5 = 0

The last number is zero so 61 divides 3598207.

[edit] General divisibility test proof

Let N be a number that we will test it, M is a factor of N. N = n1 + 10n2, M = m1 + 10m2, [M/10] = m2 and [N/10] = n2. The

Does n2m1 − m2n1 = 0 (mod M) if and only if M|N?

Let L × M = N = n1 + 10n2, L(m1 + 10m2) = n1 + 10n2

Lm1 − n1 = 10a ….(1)

−10L m2 = 10a − 10n2,

Lm2 = a − n2

n2 − Lm2 = a … (2)

add one to two and by N = M×L we find

((n1 + 10n2)(m1 − m2) + (m1 + 10m2)(n2n1))/(m1 + 10m2) = 11a, then (n2m1 − m2n1) = 0 (mod M).

[edit] See also

[edit] References

  1. ^ Su, Francis E.. "Divisibility by Seven" Mudd Math Fun Facts. Retrieved on 2006-12-12.
  2. ^ Page 274, Vedic Mathematics: Sixteen Simple Mathematical Formulae, by Swami Sankaracarya, published by Motilal Banarsidass, Varanasi, India, 1965, Delhi, 1978. 367 pages.
  3. ^ Puzzle 101. Digital Divisibility Tests

[edit] External links