Apart from dividing an integer by 7, there is another method which is often easier for testing whether 7 divides it. Remove the rightmost digit from the number you're testing, and subtract double this digit from the remaining portion. The result of this calculation will be divisible by 7 if and only if the original number is divisible by 7. The chop-double-and-subtract procedure can therefore be repeated until you obtain a number whose divisibility by 7 can be checked with the naked eye.

For example, here is how the method works in determining whether 86415 is divisible by 7:

  • Remove and double 86415's last digit (2 times 5 gives 10). Subtract this from the remaining portion: 8641 - 10 =8631.
  • The question has been reduced to determining whether 7 divides 8631; so repeat the procedure using 8631: slice off the trailing 1, double it and subtract from 863 to leave 861.
  • One more step: beginning with 861, remove the 1, double it and subtract from 86 to leave 84, which is twelve times seven.
  • Since we ended up with a multiple of seven (84) via this procedure, the original number (86415) must also be a multiple of seven.
The advantage of this method over straight division is that less mental calculations are necessary, and those which are required only involve addition and subtraction.

Proof

Here's a sketchy outline of half a proof which employs induction. Assume that some multiple of seven (call it X) has the property that it remains a multiple of seven after undergoing the chop-double-subtract procedure described above. (We note that 14 satisfies this, since 1 - 8 = -7 is a multiple of 7.) Then we claim that the next highest multiple of seven (X+7) also has this property:

Let the last digit of X be B, and the number formed by removing this digit be A. (For example, if X is 8631 then A=863 and B=1.) Then we know that removing B from X and subtracting it twice from A leaves behind a multiple of seven; that is, A-2B is a multiple of seven. Now consider the next multiple of 7 after X, that is, X+7. If B is 0, 1 or 2, then the rightmost digit of X+7 is just B+7, so performing chop-double-subtract on X+7 will give A-2(B+7) which is a multiple of 7 since, from above, A-2B is. On the other hand, if B is greater than 2, then the last digit of X+7 will be B-3 and the leading portion of X+7 will be A+1. (For example, if X is 994 then X+7 is 1001: the rightmost digit decreases by 3, while the left portion increases by 1 from 99 to 100.) In this case, performing chop-double-subtract on X+7 gives (A+1)-2(B-3)=A-2B+7, which is a multiple of seven since, from above, A-2B is.

The other half of the proof--showing that no non-multiple of seven becomes a multiple of seven after having its righmost digit removed and doubly subtracted--is left as an exercise for the interested reader.

Call me stupid, but wouldn't long division be quicker?

   12345
   ______
  | 1 2 3 3
7 |86415

Your method is great, and it works. But why go about it in such a roundabout way?


Downvote all you like, it's a neat trick, it works. I don't dispute that. I still hold that simple long division is faster.

Sure, you can cut the roof off your car with an angle grinder, climb in, hotwire the ignition and drive from point A to point B in reverse and you'll still get there. Why bother unless you're simply trying to show off, though? Using the key is far far simpler and still gets you the same result.

Here is a more formal (and perhaps simpler) way to prove jt's example of why a number is divisible by 7 if and only if its tens part less twice its ones part is.

Let x be the original number with tens part d and ones part u, and have a remainder of r when divided by 7, ie:

x = 10d + u = r mod 7

The number x will be divisible by 7 if r = 0. But it's easy to see that 3d + u = r mod 7 as well, since we can subtract 7*d without affecting the remainder.

Now subtract three times the second expression from the first:

   10d + u    ( = r mod 7)
 -3(3d + u)   ( = -3*(r mod 7))
   --------
   = d - 2u   ( = -2r mod 7)

This is just modulo arithmetic. So if r = 0 (meaning the original x was divisible by 7) then so is d - 2u above, which proves the "if" condition. If r is not 0 then d - 2u has a remainder of -2r which is not a multiple of 7, since r is not, which proves the "only if" part.


You can play these sorts of games with really any divisor, which (to answer some protests above about how "inefficient" this sort of thing is) if you're lucky produces an algorithm that is faster as a quick test than long division, especially if you're doing it in your head. Try this:

Is 242,630 divisible by 19?

While you are off doing that the hard way, jt and I will be adding twice the ones part to the tens part repeatedly, i.e. (d + 2u) in the formulation above:

242630 => 24263 => 2432 => 247 => 38 => 19.

Victory -- it is divisible by 19. We will sit down and have tea while we wait for you to do the long division in your head without making a mistake, which looks like:

    12770
19|242630
   19
   --
    52
    38
    --
    146 
    133
    ---
     133
     133
     ---
       0
       0
       -

And here's why d + 2u works for 19, using the same argument as we did for 7:

   10d + u    ( = r mod 19)
   10d + u    ( = r mod 19)
   --------
   20d + 2u   ( = 2r mod 19)
 - 19d        (    0 mod 19)
   --------
     d + 2u   ( = 2r mod 19)

and so d + 2u is 0 mod 19 if and only if r = 0, which makes the original number divisible by 19, exactly as we did for 7.

Log in or registerto write something here or to contact authors.