Could anyone explain to me why $20 ≡ -22 \pmod 6\;?$
At school we did the following method to find $-x \mod n$ by doing:
$x \mod n$ (in this case $22 \mod 6 = 4)$
$n - r$ (in this case $6-4 = 2$)
- and so the answer to $-22 \mod 6$ is $2$.
So how can it be that $20\equiv 2\pmod 6$?
$$20 = 3\cdot 6 + 2{}{}{}{}{}{}{}$$
Alternatively, let's check this out: $$20 \equiv 2 \pmod 6 \iff 6\mid (20-2) \iff 6\mid 18\;\;\large \color{green}\checkmark$$