Background
In undergraduate Abstract Algebra homework, for an integer $n$ with decimal representation $a_m a_{m-1} ... a_1 a_0$, I proved that
- $3$ divides $n \iff 3$ divides $\sum_{i = 0}^{m} a_i$, and
- $11$ divides $n \iff 11$ divides $\sum_{i = 0}^{m} (-1)^i a_i$.
Proofs of these facts can be found here and here, respectively.
My Question
For an arbitrary prime $p$, can we deterministically formulate a non-vacuous statement of the form
$$\forall n \text{ expressible as } n = a_m a_{m-1} ... a_0 \in \mathbb{N}, \text{ we have that } p \mid n \iff p \mid \sum_{i = 0}^{m} b_i a_i$$
(... where the trick of formulating this statement is coming up with the sequence $(b_i)_0^m$)? I am interested in additive structure to the primes, and I am wondering if this type of exercise could show some interesting structure.