Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

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

Ok, I found a lot of questions asking about solving $a = b \pmod c$ where you could divide $a$ and $b$ by some $x$ where gcd$(x, c) = 1$. How do you solve when this is not the case?

Suppose I have $10 x \equiv 5 \pmod{15}$. How do I solve this? How can you solve to get a linear equation in $x$?

On inspection (and trying out values), I see that $x = 3n + 2$ is what I'm looking for. How can I get this mathematically?

And yes, this is homework, but I changed the numbers so that I could practice on the actual problem ;)

share|cite|improve this question
See here. – Mhenni Benghorbal Sep 16 '12 at 5:04
up vote 1 down vote accepted

$\begin{eqnarray}\rm{\bf Hint}\ &&\rm mod\ mc\!:\ ac\,x\equiv bc&\iff&\rm mod\ m\!:\ ax\equiv b\quad for\ \ c\ne0\\ \rm &&\rm by\ \ \ \ mc\, \:|\: \ ac\,x-bc&\iff&\rm m\ |\ ax-b\\ \rm &&\rm because\ \ \ \dfrac{ac\,x-bc}{mc}&\ \ =\ \ &\rm \dfrac{ax-b}{m} \end{eqnarray}$

share|cite|improve this answer
Thanks. I'll work it out. – asymptotically Sep 17 '12 at 3:21
Essentially: we can cancel $\rm\,c\,$ from the congruences (or the equivalent divisibilty relations) because they are equivalent to said fraction being integral, and $\rm\,c\,$ cancels in the fraction. – Bill Dubuque Sep 17 '12 at 3:27

Hint: In general, if $k\ne 0$, we have $$kax\equiv kb \pmod{km} \quad\text{iff}\quad ax\equiv b \pmod{m}.$$

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.