User:Kindlychung/sandbox

\begin{theorem}[Rule of 7, divisibility test] \label{thm:rule7} Divisibility by 7 can tested as follows: \begin{enumerate} \item Take the number and multiply each digit beginning on the right hand side (ones) by 1, 3, 2, 6, 4, 5. Repeat this sequence as necessary \item Add the products. \item If the sum is divisible by 7 - so is your number. \end{enumerate} \end{theorem} \begin{proof} Observe this: \begin{align*} 10^0 &= 1 \mod{7} \\ 10^1 &= 3 \mod{7} \\ 10^2 &= 2 \mod{7} \\ 10^3 &= 6 \mod{7} \\ 10^4 &= 4 \mod{7} \\ 10^5 &= 5 \mod{7} \\ 10^6 &= 1 \mod{7} \\ \end{align*} The test should be easy to understand now, but in geeky math terms, the proof goes like this: The remainders $1,3,2,6,4,5$ repeat in a period of 6, we designate them by $r_i$, where $i=0,1,2,3,4,5$, then we have $10^{6k+i} \equiv r_i \mod{7}$, multiply both sides by the corresponding digit, the equation turns into $10^{6k+i}d_{6k+i} \equiv r_id_{6k+i} \mod{7}$, sum both sides up, we get $\sum_k\sum_{i=0}^{5}10^{6k+i}d_{6k+i} \equiv \sum_k\sum_{i=0}^{5}r_id_{6k+i} \mod{7}$, The left side is the tested number, the right side the result of   the test. \end{proof}