information:highlighting, structural:summarization, quality:correction
Divisibility by 7

Divisibility by 7 can be tested by a recursive method. A number of the form 10 x + y is divisible by 7 if and only if x − 2 y is divisible by 7. In other words, subtract twice the last digit from the number formed by the remaining digits. Continue to do this until a number is obtained for which it is known whether it is divisible by 7. The original number is divisible by 7 if and only if the number obtained using this procedure is divisible by 7. For example, the number 371: 37 − (2×1) = 37 − 2 = 35; 3 − (2 × 5) = 3 − 10 = −7; thus, since −7 is divisible by 7, 371 is divisible by 7.

Similarly a number of the form 10 x + y is divisible by 7 if and only if x + 5 y is divisible by 7. So add five times the last digit to the number formed by the remaining digits, and continue to do this until a number is obtained for which it is known whether it is divisible by 7.

Another method is multiplication by 3. A number of the form 10 x + y has the same remainder when divided by 7 as 3 x + y. One must multiply the leftmost digit of the original number by 3, add the next digit, take the remainder when divided by 7, and continue from the beginning: multiply by 3, add the next digit, etc. For example, the number 371: 3×3 + 7 = 16 remainder 2, and 2×3 + 1 = 7. This method can be used to find the remainder of division by 7.

A more complicated algorithm for testing divisibility by 7 uses the fact that 10 ≡ 1, 10 ≡ 3, 10 ≡ 2, 10 ≡ 6, 10 ≡ 4, 10 ≡ 5, 10 ≡ 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).

This method can be simplified by removing the need to multiply. All it would take with this simplification is to memorize the sequence above (132645...), and to add and subtract, but always working with one-digit numbers.

The simplification goes as follows:

If through this procedure you obtain a 0 or any recognizable multiple of 7, then the original number is a multiple of 7. If you obtain any number from 1 to 6, that will indicate how much you should subtract from the original number to get a multiple of 7. In other words, you will find the remainder of dividing the number by 7. For example, take the number 186:

Now we have a number smaller than 7, and this number (4) is the remainder of dividing 186/7. So 186 minus 4, which is 182, must be a multiple of 7.

Note: The reason why this works is that if we have: a+b=c and b is a multiple of any given number n, then a and c will necessarily produce the same remainder when divided by n. In other words, in 2 + 7 = 9, 7 is divisible by 7. So 2 and 9 must have the same remainder when divided by 7. The remainder is 2.

Therefore, if a number n is a multiple of 7 (i.e.: the remainder of n /7 is 0), then adding (or subtracting) multiples of 7 cannot change that property.

What this procedure does, as explained above for most divisibility rules, is simply subtract little by little multiples of 7 from the original number until reaching a number that is small enough for us to remember whether it is a multiple of 7. If 1 becomes a 3 in the following decimal position, that is just the same as converting 10×10 into a 3×10. And that is actually the same as subtracting 7×10 (clearly a multiple of 7) from 10×10.

Similarly, when you turn a 3 into a 2 in the following decimal position, you are turning 30×10 into 2×10, which is the same as subtracting 30×10 −28×10, and this is again subtracting a multiple of 7. The same reason applies for all the remaining conversions:

First method example 1050 → 105 − 0=105 → 10 − 10 = 0. ANSWER: 1050 is divisible by 7.

Second 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.

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. 7×7=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 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.

Vedic method example:

Pohlman–Mass method of divisibility by 7 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 1000 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:

Because 1001 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:

For all of the above examples, subtracting the first three 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 1001 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 1000, apply Step A. This can be done by subtracting the first three digits from the last three digits. For example:

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:

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

Pohlman–Mass method of divisibility by 7, examples:

Multiplication by 3 method of divisibility by 7, examples:

Finding remainder of a number when divided by 7

7 − (1, 3, 2, −1, −3, −2, cycle repeats for the next six digits) Period: 6 digits.Recurring numbers: 1, 3, 2, −1, −3, −2 Minimum magnitude sequence (1, 3, 2, 6, 4, 5, cycle repeats for the next six digits) Period: 6 digits.Recurring numbers: 1, 3, 2, 6, 4, 5 Positive sequence

Multiply the right most digit by the left most digit in the sequence and multiply the second right most digit by the second left most digit in the sequence and so on and so for. Next, compute the sum of all the values and take the modulus of 7. Example: What is the remainder when 1036125837 is divided by 7? Multiplication of the rightmost digit = 1 × 7 = 7 Multiplication of the second rightmost digit = 3 × 3 = 9 Third rightmost digit = 8 × 2 = 16 Fourth rightmost digit = 5 × −1 = −5 Fifth rightmost digit = 2 × −3 = −6 Sixth rightmost digit = 1 × −2 = −2 Seventh rightmost digit = 6 × 1 = 6 Eighth rightmost digit = 3 × 3 = 9 Ninth rightmost digit = 0 Tenth rightmost digit = 1 × −1 = −1 Sum = 33 33 modulus 7 = 5 Remainder = 5

Digit pair method of divisibility by 7

This method uses 1, −3, 2 pattern on the digit pairs. That is, the divisibility of any number by seven can be tested by first separating the number into digit pairs, and then applying the algorithm on three digit pairs (six digits). When the number is smaller than six digits, then fill zero's to the right side until there are six digits. When the number is larger than six digits, then repeat the cycle on the next six digit group and then add the results. Repeat the algorithm until the result is a small number. The original number is divisible by seven if and only if the number obtained using this algorithm is divisible by seven. This method is especially suitable for large numbers.

Example 1: The number to be tested is 157514.First we separate the number into three digit pairs: 15, 75 and 14. Then we apply the algorithm: 1 × 15 − 3 × 75 + 2 × 14 = 182 Because the resulting 182 is less than six digits, we add zero's to the right side until it is six digits. Then we apply our algorithm again: 1 × 18 − 3 × 20 + 2 × 0 = −42 The result −42 is divisible by seven, thus the original number 157514 is divisible by seven.

Example 2: The number to be tested is 15751537186. (1 × 15 − 3 × 75 + 2 × 15) + (1 × 37 − 3 × 18 + 2 × 60) = −180 + 103 = −77 The result −77 is divisible by seven, thus the original number 15751537186 is divisible by seven.

Another digit pair method of divisibility by 7

Method

This is a non-recursive method to find the remainder left by a number on dividing by 7:

For example:

The number 194,536 leaves a remainder of 6 on dividing by 7.

The number 510,517,813 leaves a remainder of 1 on dividing by 7.

Proof of correctness of the method

The method is based on the observation that 100 leaves a remainder of 2 when divided by 7. And since we are breaking the number into digit pairs we essentially have powers of 100.

1 mod 7 = 1

100 mod 7 = 2

10,000 mod 7 = 2^2 = 4

1,000,000 mod 7 = 2^3 = 8; 8 mod 7 = 1

100,000,000 mod 7 = 2^4 = 16; 16 mod 7 = 2

10,000,000,000 mod 7 = 2^5 = 32; 32 mod 7 = 4

And so on.

The correctness of the method is then established by the following chain of equalities:

Let N be the given number a 2 n a 2 n − 1... a 2 a 1 ¯ {\displaystyle {\overline {a_{2n}a_{2n-1}...a_{2}a_{1}}}}.

a 2 n a 2 n − 1... a 2 a 1 ¯ mod 7 {\displaystyle {\overline {a_{2n}a_{2n-1}...a_{2}a_{1}}}\mod 7}

mod 7 {\displaystyle {\bmod {7}}}

∑ k = 1 n (a 2 k a 2 k − 1 × 10 2 k − 2) mod 7 {\displaystyle \sum _{k=1}^{n}(a_{2k}a_{2k-1}\times 10^{2k-2}){\bmod {7}}}

∑ k = 1 n (a 2 k a 2 k − 1 mod 7) × (10 2 k − 2 mod 7) {\displaystyle \sum _{k=1}^{n}(a_{2k}a_{2k-1}{\bmod {7}})\times (10^{2k-2}{\bmod {7}})}