I have the following modular equation,
$$ (p + a) \mod 3 = m$$
which I want to solve for $a$. Of course, there are many valid values for $a$, but since I assume $m,p \in \{ 0, 1, 2\}$, I only want values of $a$ in that same range, in which case they would be unique. Is there a way to obtain an expression that gives me the value for $a$ in this range?
Hint $\,\overbrace{\bmod 3\!:\,\ p+a\equiv m\iff a\equiv m-p}^{\textstyle\text{mod as a congruence }relation } ,\,\ $ so $\ \ \overbrace{a\bmod 3 \,=\, (m-p) \bmod 3}^{\textstyle \text{mod as an } operator}$
Remark $ $ Generally, as above, to prove an equation involving $\!\bmod\!$ as an operator it is usually easiest to first convert it into the more flexible congruence relation form, prove it using congruences, then convert back to operator form at the end - as explained here.
See also here for further discussion on relational vs. operational $\!\bmod\!$.