Here's my approach to check numbers, using modular arithmetic.
(\frac{[x-x\, mod\,10^{2}]}{10^{2}}+x\, mod\,10^{2}=\frac{x\, mod\,10^{3}-x\, mod\,10}{10})
Basically, if x is the number, and it is written as abcd, the first term is ab, the second term is cd, and the right side is bc.
If we...