-2

$$ x\equiv 2 \mod 20 $$ $$ x\equiv 7 \mod 15 $$

setting $a \equiv b \mod n$ how would you approach this as the two $n$ values are not coprime?

I've broken down the $ 7\bmod15 $ into $x\equiv 7\mod3$ and $x\equiv 7\mod5$ so could treat it as simultaneous with three equations but I didn't know where to go from here?

Bernard
  • 175,478

2 Answers2

0

Hint:

Breaking also the congruence modulo $20$ leads to this system of congruences with pairwise coprime moduli: \begin{cases} x\equiv7\equiv 1\mod 3,\\ x\equiv 2\mod 4, \\ x\equiv 7\equiv 2\mod 5. \end{cases} Solve the first two congruences to obtain a congruence modulo $12$ and group the latter with the congruence modulo $5$.

Bernard
  • 175,478
-1

Just because the $n$ values share a common factor doesn't mean that you can't apply CRT. If you get a contradiction such as $x \equiv 1 \pmod 6, x \equiv 2 \pmod {15}$ which imply $x \equiv 1 \pmod 3$ and $x = 2 \pmod 3$, then there is no solution. However, you can always break down $n$ into its prime factors, as you can see in this answer.

You can directly substitute the second into the first, which gives $15k + 7 \equiv 2 \pmod {20}$, or $15k \equiv -5 \pmod {20} \implies 3k \equiv -1 \pmod {4}$. This gives $3k \equiv 3 \pmod 4$ or $k \equiv 1 \pmod 4$.

Thus the general solution is $15(4k + 1) + 7 = 60k + 22$, where $60$ is the greatest common divisor of $15$ and $20$.

Toby Mak
  • 16,827