I was looking at divisibility rules earlier today and noticed that several of them had the same form, i.e. truncating the last digit and then adding or subtracting a multiple of it to the truncation. I wanted to see if a general proof existed for any prime number, and I was able to come up with something! This is what I came up with when I tried to write out the result, but I'm not sure if it's clear or means exactly what I want:
For any prime number $p$, digit $b$, and $a\in\mathbb{Z}^+,\quad p \mid 10a+b \Leftrightarrow p \mid a\pm qb$ where $q=\min\{x\in\mathbb{Z}^+| \quad p\mid 10x\mp 1\}$.
What I mean is that $p\mid a+qb$ when $p\mid 10q-1$ and $p|a-qb$ when $p\mid 10q+1$, then I just want to take whichever $q$ is the smallest. Is the notation I used correct for that?