Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

If I have $a \equiv b \pmod{n}$, it means $n \mid b - a$.

But can you write it as $n \mid a - b$ as well?

share|cite|improve this question
$a \equiv b \pmod{n} \implies n \mid (a-b) \implies a-b = nk$ for some integer $k$. Can you find an integer $m$ such that $b-a = mn$? – JavaMan Dec 8 '11 at 4:33
Yes, because in $x$ divides $y$ if and only if $\pm x$ divides $\pm y$, and $a-b = -(b-a)$. – Arturo Magidin Dec 8 '11 at 4:33
that would just be -1. but my prof always writes it as b - a – jake Dec 8 '11 at 4:34

HINT $\rm\quad n\ |\ c \iff\ \dfrac{c}{n}\in \mathbb Z \iff -\dfrac{c}{n}\: =\: \dfrac{-c}{n} \in \mathbb Z\ \iff\ n\ |\: -c\:.\ $ Now let $\rm\ c = a-b\:.$

I.e. $\ \mathbb Z$ closed under negation $\rm\: \Rightarrow\ n\: \mathbb Z\:$ closed under negation, i.e. $\rm\: -(n\: \mathbb Z)\ =\ (-n)\ \mathbb Z$

share|cite|improve this answer

It can be written both ways. $$n\mid a-b \iff kn = a-b \iff k'n = b-a \iff n\mid b-a$$ for some $k\in \mathbb{Z}$ where $k' = -k$. It's just a way of stating that if $n\mid m$ then $n\mid (-m)$.

share|cite|improve this answer

Yes: $n\mid b-a$ means that there is an integer $k$ such that $b-a = kn$, and $n\mid a-b$ means that there is an integer $\ell$ such that $a-b=\ell n$. Since $a-b=-(b-a)$, these are two ways of saying the same thing: $$b-a = kn\iff a-b=-(b-a)=(-k)n\;.$$

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.