Checking a proof on congruences

26 Views Asked by At

I want to know if the solution for a congruence is completely solved, wrong, or what pieces are still missing.

Suppose $a$ and $-a$ have the same reminder $r$ after dividing by $m$, then $-r\equiv r\operatorname{mod}m$; that is, $2r\equiv 0\operatorname{mod} m$. Find all integers $r$ with $0<r<m$ such that $2r\equiv 0\operatorname{mod} m$ ($m$ is a positive integer).

My attempt:

If $2r\equiv 0\operatorname{mod} m$, then $m|2r$, and therefore there is an integer $q$ such that $2r=qm$. In order to $r$ to be an integer, either m or q has to be even. Suppose $m$ is even, then, since

$$ 0<r=\frac{qm}{2}<m, $$

then $q<2$, the only option is that $q=1$, and the only number that solves tyhe congruence $2r\equiv 0\operatorname{mod} m$ is $r=m/2$.