TITLE: What is the proof of divisibility by $13$?
QUESTION [7 upvotes]: While solving the question of $26^{th}$ digit given by @The Lone Wolf a question arrived in my mind; the question was
Everyone knows the divisibility rule of $13$.
Test for divisibility by $13$: Add four times the last digit to the remaining leading truncated number. If the result is divisible by 13, then so was the first number. 
For Example : $$50661$$ $$5066+4=5070$$ $$507+0=507$$ $$50+28=78$$ 
and $78$ is $6\times13$, so $50661$ is divisible by $13.$
Please help me!!!

REPLY [9 votes]: Hint $\ 13\mid 10a\!+\!b\iff 13\mid \color{#c00}4\,(10a\!+\!b)\equiv \bbox[5px,border:2px solid red]{a\!+\!4b}\pmod{\!13}$
i.e. $ $ scale $\ 10a\!+\!b\,\ $ by $\, \dfrac{1}{10}\equiv \dfrac{-12}{-3}\equiv \color{#c00}4\,\pmod{\!13}\ $ to make $a$'s coef $\equiv 1.$
Remark $ $ This works for any modulus $\,n\,$ coprime to the radix $\,r\, $ (by $1/r$ exists mod $n$ by Bezout).
However, the universal divisibility test given here is often simpler, and has the major advantage of computing true remainders, so it can be used for general arithmetic mod $n$