0

Prove that a positive integer is divisible by 7 if and only if the integer obtained by alternately adding and subtracting the three digit integers formed from the successive blocks of three decimal digits beginning with adding the block containing the units digit and working to the left is divisible by 7.

I tried using $10\equiv 3\pmod 7$ like the other divisibility rule proofs, but I don't think it works the same way for 7. A hint given in the book says 1001=(7)(11)(13)

  • 2
    $1 \equiv 1 \pmod {7}.$ $1000 \equiv -1 \pmod {7}.$ $1000000 \equiv 1 \pmod {7}.$ $1000000000 \equiv -1 \pmod {7}.$ – Will Jagy Sep 28 '16 at 00:21
  • 1
    @DERPYPENGUIN "if the integer obtained by alternately adding and subtracting the three digit integers formed from the successive blocks of three decimal digits beginning with adding the block containing the units digit and working to the left is divisible by 3." = HEADACHE... can you provide an example please? – the_candyman Sep 28 '16 at 00:25
  • Another manner: All integer $N$ can be written as $$N=\sum_{k=0}^n a_k7^k$$ where $a_k\in {0,1,2,3,4,5,6}$ (representation of $N$ in base $7$). This way you have $$N\text{ divisible by }\space 7\iff a_0=0$$. – Piquito Sep 28 '16 at 00:42
  • See http://math.stackexchange.com/questions/328562/divisibility-criteria-for-7-11-13-17-19 – lab bhattacharjee Sep 28 '16 at 04:52

2 Answers2

4

Let $b=\overline{a_1a_2....a_n}$ be an n-digit number. We can break $b$ into parts, as follows: $$ b= \overline{a_{n-2}a_{n-1}a_{n}} + 1000(\overline{a_{n-5}a_{n-4}a_{n-3}}) + 1000000(\overline{a_{n-8}a_{n-7}a_{n-6}}) + \ldots $$

Al you do now, is note that $1001=7 \times 143$ and $999999=7 \times 142857$. Similarly, you can prove that $10^{6n+3} \equiv -1 \mod 7$ (which means that $10^{6n+3}$ leaves a remainder of $-1$ (or $6$) when divided by $7$) and $10^{6n} \equiv 1 \mod 7$. Thus, when we take remainders above: $$ b \equiv \overline{a_{n-2}a_{n-1}a_{n}} + (-1)(\overline{a_{n-5}a_{n-4}a_{n-3}}) + (1)(\overline{a_{n-8}a_{n-7}a_{n-6}}) + \ldots \mod 7 $$

Thus, you can see where the pattern comes from. I'll leave the rigorous details to you.

By the way, I have simpler rule for division by $7$:

Take your number $\overline{a_1a_2\ldots a_n}$, remove the digit $a_n$, subtract $2a_n$ from the rest of the number namely $\overline{a_1a_2\ldots a_{n-1}}$. repeat this until you get a small number. If this number is divisible by $7$, then your number is divisible by $7$.

Note: instead of subtracting $2a_n$, we can even add $5a_n$, and the result remains.

I will leave it to you to test this method out and to prove it.

  • How to work on the proof of the other rule you have given? – Lalbahadur Sahu May 11 '23 at 13:49
  • 1
    @LalbahadurSahu That's easy. Suppose that your number is $10x+y$, where $y$ is the last digit and $x$ is the rest of the digits. Suppose that $10x+y$ is divisible by $7$. Then, $(10x+y)-21y = 10x - 20y = 10(x-2y)$ is also divisible by $7$. As $10$ is coprime to $7$, we get that $x-2y$ is a multiple of $7$, but that is exactly the rule I wrote (subtract $2a_n$ from the rest of the number). If you replace "divisible" by "not divisible", the argument is exactly the same. This proves the divisibility rule. You get the "add $5a_n$" part if you replace $-21y$ with $+49y$ instead. – Sarvesh Ravichandran Iyer May 11 '23 at 14:26
  • The advantage of the second rule over the first is that adding or subtracting a one digit number is really easy. If I'm not wrong (I need to check this), you can even "mix and match" : subtract twice the last digit whenever you want, and add five times it whenever you want. That makes the rule very versatile as well. – Sarvesh Ravichandran Iyer May 11 '23 at 14:27
  • Thank you so much. – Lalbahadur Sahu May 17 '23 at 03:42
  • @LalbahadurSahu You are welcome! – Sarvesh Ravichandran Iyer May 17 '23 at 03:55
1

Instead of divisible by $3$ it should be divisible by $7$. The hint means that if you have $123456789=123 \cdot 10^6 + 456 \cdot 10^3 + 789 \cdot 1$ you can use that $10^6 \equiv 1 \pmod 7$ and $10^3 \equiv -1 \pmod 7$ to write $123456789=123 \cdot 10^6 + 456 \cdot 10^3 + 789 \cdot 1\equiv 123 + 456(-1) + 789 \pmod 7$

Ross Millikan
  • 374,822