TITLE: What to do if the modulus is not coprime in the Chinese remainder theorem?
QUESTION [11 upvotes]: Chinese remainder theorem dictates that there is a unique solution if the congruence have coprime modulus.
However, what if they are not coprime, and you can't simplify further?
E.g. If I have to solve the following 5 congruence equations
$x=1 \pmod 2$
$x=1 \pmod 3$
$x=1 \pmod 4$
$x=1 \pmod 5$
$x=1\pmod 6$
as gcd (2,3,4,5,6) is not coprime, how would you do it. I have heard that you can't use the lcm of the numbers, but how does it work?
Sorry for the relatively trivial question and thank you in advance.

REPLY [2 votes]: \begin{align}
  x &\equiv 1 \pmod 2 \\
  x &\equiv 1 \pmod 3 \\
  x &\equiv 1 \pmod 4 \\
  x &\equiv 1 \pmod 5 \\
  x &\equiv 1 \pmod 6 \\
\end{align}
Note that 
$x \equiv 1 \pmod 6 \implies 
\left\{
\begin{array}{l}
    x\equiv 1 \pmod 2 \\
    x \equiv 1 \pmod 3
\end{array}
\right.$
Replace $x \equiv 1 \pmod 6$ in your original list with those two equivalences and sort the list by prime number bases:
\begin{align}
  x &\equiv 1 \pmod 2 \\
  x &\equiv 1 \pmod 2 \\ 
  x &\equiv 1 \pmod 4 \\\hline
  x &\equiv 1 \pmod 3 \\
  x &\equiv 1 \pmod 3 \\ \hline
  x &\equiv 1 \pmod 5 \\
\end{align}
Note first that $x \equiv 1 \pmod 4 \implies x \equiv 1 \pmod 2$. This means that the equivalence $x \equiv 1 \pmod 2$ is included in the equivalence $x \equiv 1 \pmod 4$ and is therefore superfluous - it can be removed.
So we can simplifiy the list to
\begin{align}
  x &\equiv 1 \pmod 4 \\
  x &\equiv 1 \pmod 3 \\
  x &\equiv 1 \pmod 5 \\
\end{align}
The solution is $x \equiv 1 \pmod{30}$.