TITLE: Proof for divisibility by $7$
QUESTION [13 upvotes]: One very classic story about divisibility is something like this.

A number is divisible by $2^n$ if the last $n$-digit of the number is divisible by $2^n$.
  A number is divisible by 3 (resp., by 9) if the sum of its digit is divisible by 3 (resp., by 9).
  A number $\overline{a_1a_2\ldots a_n}$ is divisible by 7 if $\overline{a_1a_2\ldots a_{n-1}} - 2\times a_n$ is divisible by 7 too.

The first two statements are very well known and quite easy to prove. However I could not find the way on proving the third statement.
PS: $\overline{a_1a_2\ldots a_n}$ means the digits of the number itself, not to be confused with multiplication of number.

REPLY [2 votes]: I'm taking the title of the question to allow general tests for divisibility by 7 even though the specifics of the original question is about a particular test. Apologies if this is not right - I'm still fairly new to mse.
[Source for this answer is The Lore of Large Numbers, by P. Davis, p. 87-88]
A number is divisible by 7 if and only if:
(3 * units' digit) + (2 * tens' digit) - (1 * hundreds' digit) - (3 * thousands' digit) - (2 * ten thousands' digit) + (1 * hundred thousands' digit) is divisible by 7.
If there are more digits present, the sequence of multipliers 3, 2, -1, -3, -2, 1 is repeated as often as necessary. If fewer digits are present, stop when get to the last multiplier.
Example: 
$$7 * 457404 = 3201828$$
$$
\begin{array}
&3 & * & 8 & = & 24 \\
2 & * & 2 & = &  4 \\
-1 & * & 8 & = &-8 \\
-3 & * & 1 & = &-3 \\
-2 & * & 0 & = &0  \\
1  & * & 2 & = &2  \\
3 & * & 3 & =  & 9 \\
\end{array}
$$
Since $24 + 4 - 8 - 3 + 0 + 2 + 9 = 28$ and 7 divides 28, $3201828$ is divisible by 7.
Proof for 3 digit numbers 
$$N = 100a + 10b + c,$$ then if $S$ is the sum required by the test,
$$S = -a + 2b + 3c.$$
Then $2S = -2a + 4b + 6c$ and
$N + 2S = 98a + 14b + 7c = 7(14a + 2b + c)$.
The sum $N + 2S$ is therefore a multiple of $7$, say $7M$. 
Now if $N$ is a multiple of $7$, say $7P$, then $2S = 7M - 7P = 7(M - P).$ Since therefore $2S$ is divisible by $7$ and $S$ is whole, $S$ also is divisible by $7$ (or $S = \frac{7X}{2},$ where $X$ is even because $S$ is whole). 
Conversely, if $S$ is a multiple of $7$, say $7Q$, then
$$N = 7M - 14Q = 7(M - 2Q).$$
This means that $N$  must be a multiple of $7$.
Yet another way to do it is to use a similar alternating sum test as for divisibility by 11, but in 3 digit groups, subtracting first, with the sum's divisibility by 7 determining the original number's divisibility by 7. 
In the $3201828$ example, this is $828 - 201 + 3 = 630,$ so since $630$ is divisible by $7$, so is $3201828$. I got this from http://mathforum.org/k12/mathtips/ward2.html.