How to know when it's possible to solve a modular equation?

43 Views Asked by At

In my professor's notes there's the following example:

$$21x \equiv 15 \pmod{39} \Leftrightarrow 21x - 39y = 15$$

It reads:

Because $\gcd(21,-39) = 3$ and $3\mid15$, this equation has a solution.

This confuses me because just earlier, and on articles I've read on the internet what it always says is that these equations are only possible if gcd(21,39) (in this case) equals 1, or that they are relatively prime. Now I am just confused. Which one is it?

1

There are 1 best solutions below

0
On

You can divide both sides of $21x−39y=15$ by $3=\gcd(21,39)$ to get $7x-13y=5$, which has relatively prime coefficients and is therefore always solveable.

On the other hand, if you had had $21x−39y=14$, you couldn't divide both sides by $3$, so that's an example of a linear diophantine relation with no solutions. That's why it is important that the GCD of the two coefficients is a factor of the constant.