Proof of the divisibility rule of 17.
Solution 1:
Write your number $10a+b$.
Then because 10 and 17 are relatively prime, $$17\mid a-5b \iff 17\mid 10a-50b \iff 17\mid 10a+b$$ The last equivalence is because $10a+b-(10a-50b) = 51b$ is always a multiple of 17.
Solution 2:
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.
Solution 3:
10x+y will be divisible by an odd prime p iff a.p.x ~ b(10x+y) is divisible by p.
Now by Euclid's GCD algorithm, we can find integers a,b such that a.p ~ b.10=1 where (p,10)=1.
If p=17, by observation 3.17 - 5.10=1.
So, 3.17.x-5(10x+y)=x-5y.
If this is divisible by 17, so will be 10x+y.