Difference between revisions of "Divisibility rules"

(Divisibility Rule for 7)
m (Bigger blocks -- 10001 and 10000001)
 
(49 intermediate revisions by 17 users not shown)
Line 1: Line 1:
These '''divisibility rules''' help determine when [[integers]] are [[divisibility | divisible]] by particular other integers.
+
These '''divisibility rules''' help determine when [[positive integer]]s are [[divisibility | divisible]] by particular other [[integer]]s.  All of these rules apply for [[Base number| base-10]] ''only'' -- other bases have their own, different versions of these rules.
  
 +
==Divisibility Videos==
 +
https://youtu.be/bIipw2XSMgU
 +
https://youtu.be/6xNkyDgIhEE?t=1699
  
== Divisibility Rule for 2 and Powers of 2 ==
+
==Basics==
A number is divisible by <math>2^n</math> if the last <math>{n}</math> digits of the number are divisible by <math>2^n</math>.
 
  
 +
=== Divisibility Rule for 2 and Powers of 2 ===
 +
A number is divisible by <math>2^n</math> if and only if the last <math>{n}</math> digits of the number are divisible by <math>2^n</math>.  Thus, in particular, a number is divisible by 2 if and only if its units digit is divisible by 2, i.e. if the number ends in 0, 2, 4, 6 or 8.
  
== Divisibility Rule for 3 and 9==
+
[[Divisibility rules/Rule for 2 and powers of 2 proof | Proof]]
A number is divisible by 3 or 9 if the sum of its digits is divisible by 3 or 9, respectively.  Note that this does ''not'' work for higher powers of 3.  For instance, the sum of the digits of 1899 is divisible by 27, but 1899 is not itself divisible by 27.
 
  
== Divisibility Rule for 5 and Powers of 5 ==
+
=== Divisibility Rule for 3 and 9===
A number is divisible by <math>5^n</math> if the last n digits are divisible by that power of 5.
+
A number is divisible by 3 or 9 if and only if the sum of its digits is divisible by 3 or 9, respectively.  Note that this does ''not'' work for higher powers of 3.  For instance, the sum of the digits of 1899 is divisible by 27, but 1899 is not itself divisible by 27.
  
 +
[[Divisibility rules/Rule for 3 and 9 proof | Proof]]
  
=== Proof ===
+
=== Divisibility Rule for 5 and Powers of 5 ===
An understanding of [[Introduction to modular arithmetic | basic modular arithmetic]] is necessary for this proof.
+
A number is divisible by <math>5^n</math> if and only if the last <math>n</math> digits are divisible by that power of 5.
  
Consider, for example, the test for divisibility by <math>9</math>:
+
[[Divisibility rules/Rule for 5 and powers of 5 proof | Proof]]
  
''Let <math>N</math> be a positive integer.  Then <math>N</math> is divisible by <math>9</math> if and only if the sum of the base-ten digits of <math>N</math> is divisible by <math>9</math>.''
+
=== Divisibility Rule for 7 ===
 +
Rule 1:  Partition <math>N</math> into 3 digit numbers from the right (<math>d_3d_2d_1,d_6d_5d_4,\dots</math>).  The alternating sum (<math>d_3d_2d_1 - d_6d_5d_4 + d_9d_8d_7 - \dots</math>) is divisible by 7 if and only if <math>N</math> is divisible by 7.
  
Arithmetic mod <math>9</math> can be used to give an easy proof of this criterion:
+
[[Divisibility rules/Rule 1 for 7 proof | Proof]]
  
Suppose that the base-ten representation of <math>N</math> is
+
Rule 2:  Truncate the last digit of <math>N</math>, double that digit, and subtract it from the rest of the number (or vice-versa).  <math>N</math> is divisible by 7 if and only if the result is divisible by 7. 
  
<math>N = a_k a_{k-1} \cdots a_2 a_1 a_0</math>,
+
[[Divisibility rules/Rule 2 for 7 proof | Proof]]
  
where <math>a_i</math> is a digit for each <math>i</math>.  Then the numerical value of <math>N</math> is given by
+
Rule 3:  "Tail-End divisibility."  Note.  This only tells you if it is divisible and NOT the remainder.  Take a number say 12345.  Look at the last digit and add or subtract a multiple of 7 to make it zero.  In this case we get 12380 or 12310 (both are acceptable; I am using the former).  Lop off the ending 0's and repeat.  1238 - 28 ==> 1210 ==> 121 - 21 ==> 100 ==>  1  NOPEWorks in general with numbers that are relatively prime to the base (and works GREAT in binary).  Here's one that works.  12348 - 28 ==> 12320 ==> 1232 +28 ==> 1260 ==> 126 + 14 ==> 14 YAY!
  
<math>N = a_k \cdot 10^k + a_{k-1} \cdot 10^{k-1} + \cdots + a_1 \cdot 10^1 + a_0 \cdot 10^0</math>.
+
Tiny extension to tell you the remainder:
  
Now we know that, since <math>10 - 1 = 9</math>, we have <math>10 \equiv 1</math> (mod <math>9</math>).  So by the "exponentiation" property above, we have <math>10^j \equiv 1^j \equiv 1</math> (mod <math>9</math>) for every <math>j</math>.
+
Count how many zeroes you lop off and mod 6.
  
Therefore, by repeated uses of the "addition" and "multiplication" properties, we can write
+
Multiply mod 7 with the corresponding number
  
<math>a_k \cdot 10^k + a_{k-1} \cdot 10^{k-1} + \cdots + a_1 \cdot 10^1 + a_0 \cdot 10^0 \equiv a_k \cdot 1 + a_{k-1} \cdot 1 + \cdots + a_1 \cdot 1 + a_0 \cdot 1</math> (mod <math>9</math>).
+
Zeroes (mod 6)  Number to multiply by
 +
 +
      0                   1
 +
      1                   3
 +
      2                    2
 +
      3                    6
 +
      4                    4
 +
      5                    5
  
Therefore, we have
+
And that's the remainder.
  
<math>N \equiv a_k + a_{k-1} + \cdots + a_1 + a_0</math> (mod <math>9</math>).
+
=== Divisibility Rule for 10 and Powers of 10===
 +
If a number is power of 10, define it as a power of 10. The exponent is the number of zeros that should be at the end of a number for it to be divisible by that power of 10.
  
That is, <math>N</math> differs from the sum of its digits by a multiple of <math>9</math>.  It follows, then, that <math>N</math> is a multiple of <math>9</math> if and only if the sum of its digits is a multiple of <math>9</math>.
+
Example:
 +
A number needs to have 6 zeroes at the end of it to be divisible by 1,000,000 because <math>1,000,000=10^6</math>.
  
Since we also have <math>10 \equiv 1 \pmod 3</math>, the same proof also gives the divisibility rule for 3.  The proof fails for 27 because <math>10 \not\equiv 1 \pmod{27}</math>.
+
=== Divisibility Rule for 11 ===
 +
A number is divisible by 11 if the [[alternating sum]] of the digits is divisible by 11.
  
== Divisibility Rule for 11 ==
+
[[Divisibility rules/Rule for 11 proof | Proof]]
A number is divisible by 11 if the alternating sum of the digits is divisible by 11.
 
  
 +
=== General Rule for Composites ===
 +
A number is divisible by <math>N</math>, where the [[prime factorization]] of <math>N</math> is <math>p_1^{e_1}p_2^{e_2}\cdots p_n^{e_n}</math>, if the number is divisible by each of <math>p_1^{e_1}, p_2^{e_2},\ldots, p_n^{e_n}</math>.
  
===Proof===
+
==== Example ====
  
<math>10\equiv -1\pmod{11}</math>.  Since the number is in base 10, as we assume, the digits would be of powers of 10, or in mod 11, powers of -1. The number 3806 thus becomes:
+
For the example, we will check if 55682168544 is divisible by 36.
  
<math>3\cdot (-1)^3+8\cdot (-1)^2+0\cdot (-1)^1+6\cdot (-1)^0=-3+8-0+6\equiv 0\pmod{11}</math>.
+
The prime factorization of 36 to be <math>2^2\cdot 3^2</math>.  Thus we must check for divisibility by 4 and 9 to see if it's divisible by 36.
  
== Divisibility Rule for 7 ==
+
* Since the last two digits, 44, of the number is divisible by 4, so is the entire number.
Rule 1:  Partition <math>n</math> into 3 digit numbers from the right (<math>d_3d_2d_1,d_6d_5d_4,\dots</math>).  If the alternating sum (<math>d_3d_2d_1 - d_6d_5d_4 + d_9d_8d_7 - \dots</math>) is divisible by 7, then the number is divisible by 7.<br>
+
* To check for divisibility by 9, we look to see if the sum of the digits is divisible by 9The sum of the digits is 54 which is divisible by 9.
<br>
 
Rule 2:  Truncate the last digit of <math>{n}</math>, and double that digit, subtracting the rest of the number from the doubled last digitIf the absolute value of the result is a multiple of 7, then the number itself is. <br>
 
  
===Proof for Rule 2:===
+
Thus, the number is divisible by both 4 and 9 and must be divisible by 36.
  
The divisibility rule would be <math>2n_0-k</math>, where <math>k=d_110^0+d_210^1+d_310^2+...</math>, where <math>d_{n-1}</math> is the nth digit from the right (NOT the left) and we have <math>k-2n_0\equiv 2n_0+6k</math> and since 2 is relatively prime to 7, <math>2n_0+6k\equiv n_0+3k\pmod{7}</math>.  Then yet again <math>n_0+3k\equiv n_0+10k\pmod{7}</math>, and this is equivalent to our original number.
+
==Advanced==
  
== Divisibility Rule for 13 ==
+
=== General Rule for Primes ===
Multiply the last digit by 4 and add it to the rest of the number.  This process can be repeated for large numbers, as is with the divisibility rule for 7.
+
For every [[prime number]] other than 2 and 5, there exists a rule similar to rule 2 for divisibility by 7.  For a general prime <math>p</math>, there exists some number <math>q</math> such that an integer is divisible by <math>p</math> if and only if truncating the last digit, multiplying it by <math>q</math> and subtracting it from the remaining number gives us a result divisible by <math>p</math>.  Divisibility rule 2 for 7 says that for <math>p = 7</math>, <math>q = 2</math>.  The divisibility rule for 11 is equivalent to choosing <math>q = 1</math>The divisibility rule for 3 is equivalent to choosing <math>q = -1</math>.  These rules can also be found under the appropriate conditions in [[number base]]s other than 10.  Also note that these rules exist in two forms: if <math>q</math> is replaced by <math>p - q</math> then subtraction may be replaced with addition.  We see one instance of this in the divisibility rule for 13: we could multiply by 9 and subtract rather than multiplying by 4 and adding.
  
===Proof===
+
<math>q</math> is any number so that <math>p|(10q+1)</math>
Say <math>k=d_110^0+d_210^1+d_310^2+...</math>, where <math>d_{n+1}</math> is the nth digit from the right  (NOT THE LEFT).  The rule becomes <math>4d_0+k\equiv 4d_0-12k\pmod{13}</math>.  Then <math>4d_0-12k\equiv d_0-3k\pmod{13}</math>, because you can divide by 4 in any instance mod 13.  This goes further to <math>d_0+10k</math>, inspecting closely, this is our original number!
 
  
==More general note ==
+
=== Divisibility Rule for 13 ===
For every [[prime number]] other than 2 and 5, there exists a rule similar to rule 2 for divisibility by 7For a general prime <math>p</math>, there exists some number <math>q</math> such that an integer is divisible by <math>p</math> if and only if truncating the last digit, multiplying it by <math>q</math> and subtracting it from the remaining number gives us a result divisible by <math>p</math>Divisibility rule 2 for 7 says that for <math>p = 7</math>, <math>q = 2</math>.  The divisibility rule for 11 is equivalent to choosing <math>q = 1</math>The divisibility rule for 3 is equivalent to choosing <math>q = -1</math>.  These rules can also be found under the appropriate conditions in [[number base]]s other than 10.
+
Rule 1: Truncate the last digit, multiply it by 4 and add it to the rest of the numberThe result is divisible by 13 if and only if the original number was divisble by 13This process can be repeated for large numbers, as with the second divisibility rule for 7.   
  
 +
[[Divisibility rules/Rule 1 for 13 proof | Proof]]
  
== Example Problems ==
+
Rule 2:  Partition <math>N</math> into 3 digit numbers from the right (<math>d_3d_2d_1,d_6d_5d_4,\dots</math>).  The alternating sum (<math>d_3d_2d_1 - d_6d_5d_4 + d_9d_8d_7 - \dots</math>) is divisible by 13 if and only if <math>N</math> is divisible by 13.
* [[2006_AMC_10B_Problems/Problem_25 | 2006 AMC 10B Problem 25]]
+
 
 +
[[Divisibility rules/Rule 2 for 13 proof | Proof]]
 +
 
 +
Rule 3:  Works for <math>1 \leq N \leq 1000</math>.  Let <math>K = 3N</math>.  If <math>K</math> is odd add 39 to <math>K</math>.  Round <math>K</math> up to the nearest multiple of 80, call the result <math>T</math>.  Find <math>R = (T - K)/2</math>.  Check: Is <math>T = R \cdot 80</math>.
 +
 
 +
[[Divisibility rules/Rule 3 for 13 proof | Proof]]
 +
 
 +
===Divisibility Rule for 17===
 +
Truncate the last digit, multiply it by 5 and subtract from the remaining leading number.  The number is divisible if and only if the result is divisible.  The process can be repeated for any number.
 +
 
 +
[[Divisibility rules/Rule for 17 proof | Proof]]
 +
 
 +
===Divisibility Rule for 19===
 +
Truncate the last digit, multiply it by 2 and add to the remaining leading number.  The number is divisible if and only if the result is divisible.  This can also be repeated for large numbers.
 +
 
 +
[[Divisibility rules/Rule for 19 proof | Proof]]
 +
 
 +
===Divisibility Rule for 29===
 +
Truncate the last digit, multiply it by 3 and add to the remaining leading number.  The number is divisible if and only if the result is divisible.  This can also be repeated for large numbers.
 +
 
 +
[[Divisibility rules/Rule for 29 proof | Proof]]
 +
 
 +
===Divisibility Rule for 49===
 +
Why 49?  For taking pesky <math>7^2</math> out of a root.
 +
 
 +
Useful below 4900.  Round up to a multiple of 50, call it <math>A</math>, and subtract the original number, call this <math>D</math>.  If <math>A = 50 \cdot D</math> , it is divisible by 49.
 +
 
 +
Examples:
 +
 
 +
49.  Round up: <math>A = 50</math>. Difference: <math>D = 1</math>.  <math>A = 50 \cdot D</math>? Yes!
 +
 
 +
1501.  Round up: <math>A = 1550</math>. Difference: <math>D = 49</math>.  <math>A = 50 \cdot D</math>? No!
 +
 
 +
1470.  Round up: <math>A = 1500</math>. Difference: <math>D = 30</math>.  <math>A = 50 \cdot D</math>? Yes!
 +
 
 +
Extension to work for all numbers.
 +
Floor divide by 4950, multiply by 50, and add to <math>A</math> before calculating <math>D</math>
 +
 
 +
[[Divisibility rules/Rule for 49 proof | Proof]]
 +
 
 +
==Special==
 +
 
 +
===Mod-preserving tests===
 +
 
 +
These tests allow you take the modulo operation easily.
 +
 
 +
====Mod-preserving for 7====
 +
Multiply the first digit by 3 and add it to the rest.
 +
 
 +
====Mod-preserving for 13====
 +
Multiply the first digit by 3 and subtract it from the rest
 +
 
 +
===Block tests===
 +
 
 +
As a bonus, these are also mod-preserving
 +
 
 +
====Small blocks -- 101 and 1001====
 +
The divisibility for 101 test is simple:
 +
Alternate adding and subtracting blocks of two digits starting from the end two, which are added.
 +
 
 +
Ex. 1102314 by 101
 +
 
 +
- 01 + 10 - 23 + 14 ← last block is always two digits and positive
 +
=0
 +
so 1102314 is divisible by 101
 +
 
 +
The divisibility for 1001 is the same, but with blocks of three. (Starting with the end **three**, this time)
 +
 
 +
The 1001 test also works for all it's divisors. The most useful are 7, 11, and 13.
 +
====Bigger blocks -- 10001 and 10000001====
 +
10001 has block size length 4, and factors nicely into 73*137.
 +
 
 +
1000001 has block size 6, and factors into 17*5882353. 5882353 isn't much use, but 17 is, when we're testing a large number.
 +
 
 +
====Type 2 blocks -- 111 and 11111====
 +
A different type of test can be yielded from adding all the blocks, but again starting with the end.
 +
 
 +
111 has a block length of three, and factors into 37 and 3.
 +
 
 +
11111 has a length of five, and factors to 41 and 271.
 +
 
 +
1111111, with a length of seven, can provide a test for 239 and 4649, if you ever need it.
 +
 
 +
== Problems ==
 +
 
 +
* Practice Problems on [https://artofproblemsolving.com/alcumus/ Alcumus]
 +
** Divisibility (Prealgebra)
 +
* [[2000 AMC 8 Problems/Problem 11]]
 +
* [[2006 AMC 10B Problems/Problem 25]]
  
  
Line 81: Line 183:
 
==== Books ====
 
==== Books ====
 
* The AoPS [http://www.artofproblemsolving.com/Books/AoPS_B_Item.php?page_id=10 Introduction to Number Theory] by [[Mathew Crawford]].
 
* The AoPS [http://www.artofproblemsolving.com/Books/AoPS_B_Item.php?page_id=10 Introduction to Number Theory] by [[Mathew Crawford]].
 +
* The [http://www.artofproblemsolving.com/Books/AoPS_B_Item.php?page_id=1 Art of Problem Solving] by [[Sandor Lehoczky]] and [[Richard Rusczyk]].
 +
 
==== Classes ====
 
==== Classes ====
 
* [http://www.artofproblemsolving.com/Classes/AoPS_C_ClassesS.php#begnum AoPS Introduction to Number Theory Course]
 
* [http://www.artofproblemsolving.com/Classes/AoPS_C_ClassesS.php#begnum AoPS Introduction to Number Theory Course]
Line 91: Line 195:
 
* [[Math books]]
 
* [[Math books]]
 
* [[Mathematics competitions]]
 
* [[Mathematics competitions]]
 +
 +
[[Category:Divisibility Rules]]

Latest revision as of 21:11, 22 September 2024

These divisibility rules help determine when positive integers are divisible by particular other integers. All of these rules apply for base-10 only -- other bases have their own, different versions of these rules.

Divisibility Videos

https://youtu.be/bIipw2XSMgU https://youtu.be/6xNkyDgIhEE?t=1699

Basics

Divisibility Rule for 2 and Powers of 2

A number is divisible by $2^n$ if and only if the last ${n}$ digits of the number are divisible by $2^n$. Thus, in particular, a number is divisible by 2 if and only if its units digit is divisible by 2, i.e. if the number ends in 0, 2, 4, 6 or 8.

Proof

Divisibility Rule for 3 and 9

A number is divisible by 3 or 9 if and only if the sum of its digits is divisible by 3 or 9, respectively. Note that this does not work for higher powers of 3. For instance, the sum of the digits of 1899 is divisible by 27, but 1899 is not itself divisible by 27.

Proof

Divisibility Rule for 5 and Powers of 5

A number is divisible by $5^n$ if and only if the last $n$ digits are divisible by that power of 5.

Proof

Divisibility Rule for 7

Rule 1: Partition $N$ into 3 digit numbers from the right ($d_3d_2d_1,d_6d_5d_4,\dots$). The alternating sum ($d_3d_2d_1 - d_6d_5d_4 + d_9d_8d_7 - \dots$) is divisible by 7 if and only if $N$ is divisible by 7.

Proof

Rule 2: Truncate the last digit of $N$, double that digit, and subtract it from the rest of the number (or vice-versa). $N$ is divisible by 7 if and only if the result is divisible by 7.

Proof

Rule 3: "Tail-End divisibility." Note. This only tells you if it is divisible and NOT the remainder. Take a number say 12345. Look at the last digit and add or subtract a multiple of 7 to make it zero. In this case we get 12380 or 12310 (both are acceptable; I am using the former). Lop off the ending 0's and repeat. 1238 - 28 ==> 1210 ==> 121 - 21 ==> 100 ==> 1 NOPE. Works in general with numbers that are relatively prime to the base (and works GREAT in binary). Here's one that works. 12348 - 28 ==> 12320 ==> 1232 +28 ==> 1260 ==> 126 + 14 ==> 14 YAY!

Tiny extension to tell you the remainder:

Count how many zeroes you lop off and mod 6.

Multiply mod 7 with the corresponding number

Zeroes (mod 6)   Number to multiply by

     0                    1
     1                    3
     2                    2
     3                    6
     4                    4
     5                    5

And that's the remainder.

Divisibility Rule for 10 and Powers of 10

If a number is power of 10, define it as a power of 10. The exponent is the number of zeros that should be at the end of a number for it to be divisible by that power of 10.

Example: A number needs to have 6 zeroes at the end of it to be divisible by 1,000,000 because $1,000,000=10^6$.

Divisibility Rule for 11

A number is divisible by 11 if the alternating sum of the digits is divisible by 11.

Proof

General Rule for Composites

A number is divisible by $N$, where the prime factorization of $N$ is $p_1^{e_1}p_2^{e_2}\cdots p_n^{e_n}$, if the number is divisible by each of $p_1^{e_1}, p_2^{e_2},\ldots, p_n^{e_n}$.

Example

For the example, we will check if 55682168544 is divisible by 36.

The prime factorization of 36 to be $2^2\cdot 3^2$. Thus we must check for divisibility by 4 and 9 to see if it's divisible by 36.

  • Since the last two digits, 44, of the number is divisible by 4, so is the entire number.
  • To check for divisibility by 9, we look to see if the sum of the digits is divisible by 9. The sum of the digits is 54 which is divisible by 9.

Thus, the number is divisible by both 4 and 9 and must be divisible by 36.

Advanced

General Rule for Primes

For every prime number other than 2 and 5, there exists a rule similar to rule 2 for divisibility by 7. For a general prime $p$, there exists some number $q$ such that an integer is divisible by $p$ if and only if truncating the last digit, multiplying it by $q$ and subtracting it from the remaining number gives us a result divisible by $p$. Divisibility rule 2 for 7 says that for $p = 7$, $q = 2$. The divisibility rule for 11 is equivalent to choosing $q = 1$. The divisibility rule for 3 is equivalent to choosing $q = -1$. These rules can also be found under the appropriate conditions in number bases other than 10. Also note that these rules exist in two forms: if $q$ is replaced by $p - q$ then subtraction may be replaced with addition. We see one instance of this in the divisibility rule for 13: we could multiply by 9 and subtract rather than multiplying by 4 and adding.

$q$ is any number so that $p|(10q+1)$

Divisibility Rule for 13

Rule 1: Truncate the last digit, multiply it by 4 and add it to the rest of the number. The result is divisible by 13 if and only if the original number was divisble by 13. This process can be repeated for large numbers, as with the second divisibility rule for 7.

Proof

Rule 2: Partition $N$ into 3 digit numbers from the right ($d_3d_2d_1,d_6d_5d_4,\dots$). The alternating sum ($d_3d_2d_1 - d_6d_5d_4 + d_9d_8d_7 - \dots$) is divisible by 13 if and only if $N$ is divisible by 13.

Proof

Rule 3: Works for $1 \leq N \leq 1000$. Let $K = 3N$. If $K$ is odd add 39 to $K$. Round $K$ up to the nearest multiple of 80, call the result $T$. Find $R = (T - K)/2$. Check: Is $T = R \cdot 80$.

Proof

Divisibility Rule for 17

Truncate the last digit, multiply it by 5 and subtract from the remaining leading number. The number is divisible if and only if the result is divisible. The process can be repeated for any number.

Proof

Divisibility Rule for 19

Truncate the last digit, multiply it by 2 and add to the remaining leading number. The number is divisible if and only if the result is divisible. This can also be repeated for large numbers.

Proof

Divisibility Rule for 29

Truncate the last digit, multiply it by 3 and add to the remaining leading number. The number is divisible if and only if the result is divisible. This can also be repeated for large numbers.

Proof

Divisibility Rule for 49

Why 49? For taking pesky $7^2$ out of a root.

Useful below 4900. Round up to a multiple of 50, call it $A$, and subtract the original number, call this $D$. If $A = 50 \cdot D$ , it is divisible by 49.

Examples:

49. Round up: $A = 50$. Difference: $D = 1$. $A = 50 \cdot D$? Yes!

1501. Round up: $A = 1550$. Difference: $D = 49$. $A = 50 \cdot D$? No!

1470. Round up: $A = 1500$. Difference: $D = 30$. $A = 50 \cdot D$? Yes!

Extension to work for all numbers. Floor divide by 4950, multiply by 50, and add to $A$ before calculating $D$

Proof

Special

Mod-preserving tests

These tests allow you take the modulo operation easily.

Mod-preserving for 7

Multiply the first digit by 3 and add it to the rest.

Mod-preserving for 13

Multiply the first digit by 3 and subtract it from the rest

Block tests

As a bonus, these are also mod-preserving

Small blocks -- 101 and 1001

The divisibility for 101 test is simple: Alternate adding and subtracting blocks of two digits starting from the end two, which are added.

Ex. 1102314 by 101

- 01 + 10 - 23 + 14 ← last block is always two digits and positive =0 so 1102314 is divisible by 101

The divisibility for 1001 is the same, but with blocks of three. (Starting with the end **three**, this time)

The 1001 test also works for all it's divisors. The most useful are 7, 11, and 13.

Bigger blocks -- 10001 and 10000001

10001 has block size length 4, and factors nicely into 73*137.

1000001 has block size 6, and factors into 17*5882353. 5882353 isn't much use, but 17 is, when we're testing a large number.

Type 2 blocks -- 111 and 11111

A different type of test can be yielded from adding all the blocks, but again starting with the end.

111 has a block length of three, and factors into 37 and 3.

11111 has a length of five, and factors to 41 and 271.

1111111, with a length of seven, can provide a test for 239 and 4649, if you ever need it.

Problems


Resources

Books

Classes


See also