0

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?

  • The usual way a mathematician would frame this is as an equation "modulo 3": $$ p+a \equiv m \bmod 3 $$ in which $p,a,m$ are understood to be residues modulo 3. – hardmath Oct 24 '19 at 14:21
  • @hardmath It's not clear what you mean by mixing an operational mod with a congruence relation, but they are integers, not residues, if you intend a congruence. – Bill Dubuque Oct 24 '19 at 14:34

1 Answers1

3

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\!$.

Bill Dubuque
  • 272,048