Velvet Star Monitor

Standout celebrity highlights with iconic style.

news

Divisibility by 7

Writer Matthew Barrera
$\begingroup$

What is the fastest known way for testing divisibility by 7? Of course I can write the decimal expansion of a number and calculate it modulo 7, but that doesn't give a nice pattern to memorize because 3 is a primitive root. I'm looking for alternative ways that can help you decide when a number is divisible by 7 by hand.

I'm sorry if this is a duplicate question, but I didn't find anything similar on the site.

$\endgroup$ 12

6 Answers

$\begingroup$

One rule I use pretty much is:

If you double the last digit and subtract it from the rest of the number and the answer is: 0, or divisible by 7 then the number itself is divisible by 7.

Example:

  • 672 (Double 2 is 4, 67-4=63, and 63÷7=9) Yes
  • 905 (Double 5 is 10, 90-10=80, and 80÷7=11 3/7) No

If the number is too big you can repeat until you find the solution.

$\endgroup$ 4 $\begingroup$

Another way to do this is to use a divisibility graph (see: How does the divisibility graphs work?). They're not to difficult to remember/generate for small numbers.

Divisibility Graph For 7

To compute mod 7 for n: Start at 0. For each digit x in n traverse x black arrows in the graph then, in between digits, follow the blue arrows.

example:

Take 6594:

  1. Digit is 6, traverse 6 black arrows, ending on node 6 then follow blue arrow to node 4
  2. Digit is 5, traverse 5 black arrows, ending on node 2 then follow blue arrow to node 6
  3. Digit is 9, traverse 9 (or 2 as 9 mod 7 = 2) black arrows, ending on node 1 then follow blue arrow to node 3
  4. Digit is 4, traverse 4 black arrows, ending on node 0

6594 mod 7 = 0

$\endgroup$ $\begingroup$

Here are some pointers:
Divisibility by 7
Divisibility rules

$\endgroup$ 1 $\begingroup$

The best way to test if a number is divisible by any other number is by deducting the number n times and check whether the remainder is divisible by n. for example 861-7n/7. Here 7n must be lesser or equal to 861.

$\endgroup$ 1 $\begingroup$

I created this algorithm that is very quick: N = a,bcd; a' = (- cd mod 7 + a) mod 7; If 7|a'b then 7|N; If N is larger repeat the procedure. It works because - cd mod 7 ≡ 6 cd; 6 cd goes to the place value of the thousands. Then N is submitted to the addition of 6,000 cd and to the subtraction of 1 cd: 6,000 - 1 = 5,999 and 7|5,999. Each time the procedure is applied a multiple of 7 is added to N. With practice it may be applied entirely through mental calculation. Watch this video that shows the application of the algorithm:

$\endgroup$ $\begingroup$

The rule $7 \mid 10n+d \iff 7 \mid n-2d$ works fine when the number $10n+d$ is "small" but it would be too much work for, say, the number $2726394118$

However, the fact that $7 \mid 1001$ can be used to speed things up a bit. First, we note that $1000^m \equiv (-1)^m \pmod{1001}$. This implies the following method.

  • Break the number up into periods of $3$ digits (from right to left).

$$2726394118 \mapsto 2 \quad 726 \quad 394 \quad 118$$

  • Sum the odd periods

$$118 + 726 = 844$$

  • Sum the even periods

$$2 + 394 = 396$$

  • Compute the difference

$$844-396 = 448$$

  • The original number is divisible by $7$ if and only if the difference divisible by $7$.

$$448 \mapsto 44-16 = 28$$

Since $7$ divides $28$, then $7$ divides $2726394118$.

$\endgroup$

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy