# prove a=b (mod n) then ra=rb(mod n)

I seem to not be able to find anything about these type of questions, could anyone help me prove the following question. Start up on how to do the question would be appreciated too!

$a≡b \mod n$,then $ra≡rb \mod n$,

• Hint: if $a \equiv b \pmod n$, then $a-b = kn$ for some $k \in \mathbb{Z}$. Then $r(a-b) = ra-rb = \ldots$ – Alex Wertheim Apr 27 '14 at 21:35

$a \equiv b \pmod{n} \iff n|(a-b)$. Knowing this, then certainly $n|r(a-b)$.
Hence, $n|(ra-rb) \iff ra \equiv rb \pmod{n}$.
The answer by Kaj Hansen is very good. Here's a slightly different approach with simple equalities like we all know them : $$a\equiv b \mod n \Longleftrightarrow a = b + kn\Longrightarrow ra = rb + (rk)n$$
Writing it back under modulo form you obtain $ra \equiv rb \mod n$
• The last “if and only if” works only for $r\ne0$. You only need $\Rightarrow$, though. Moreover, it's false in general that $ra\equiv rb\pmod{n}$ implies $a\equiv b\pmod{n}$. – egreg Apr 27 '14 at 21:42