Given a number presented in decimal form $n=\sum_{k=0} d_k10^k$ there are some nice thumb rules to decide whether it is divisible with a prime number $p\in\{7,11,13,17,19,23,29\}$.
For each of this numbers there is a number $a_p$ such that $p|n\iff p|(a_p\cdot d_0+\sum_{k=0} d_{k+1}10^k)$.
$a_7=-2,\;a_{11}=-1,\;a_{13}=4,\;a_{17}=-5,\;a_{19}=2,\;a_{23}=7,\;a_{29}=3$
E.g. $\;19\cdot 17=323$ and $32+2\cdot 3=38=2\cdot 19$ and $32-5\cdot 3=17$.
Is there a number $a_{31}$ that works the same way? Or $a_p,\;p\ge37$?
$$ \bbox[6px,border:1px solid #c00]{p\mid 10,b+a \iff p\mid b+c,a}\ \ {\rm for}\ \ c\equiv {10}^{-1}!!!!\pmod{!p},\ \ 2,5\nmid p\qquad $$
e.g. for $,p=29,$ we have $\bmod 29!:\ c\equiv \dfrac{1}{10}\equiv \dfrac{3}{30}\equiv \dfrac{3}1,$ by here. $\ \ $
– Bill Dubuque Nov 27 '23 at 19:27