Proof of the divisibility rule of 17. 
Rule: Subtract 5 times the last digit from the rest of the number, if the 
      result is divisible by 17 then the number is also divisible by 17.

How does this rule work? Please give the proof.

Let 
$$n=\sum_{k=0}^N 10^k a_k$$ 
be the number we want to test for divisibility, where the $a_k$s are the digits in the decimal expansion of $n$. We form the second number $m$ by the process you describe, $$m = \sum_{k=1}^N 10^{k-1} a_k - 5 a_0 = \frac{n-a_0}{10}- 5 a_0 $$
 Now suppose $17|m$. Then there exists a natural number $b$ such that $17b = m$. We then have 
$$
17 b = \frac{n-a_0}{10}- 5 a_0 
$$
$$
10 * 17 b = n-a_0- 50 a_0  \implies n= 17(10b + 3a_0)
$$
and so $n$ is divisible by 17.
