Solving system Chinese Remainder Theorem

chinese remainder theoremmodular arithmetic

I have to calculate $2019x \equiv18^{2019} \, mod \, 45$

This is equivalent to: \begin{cases} 2019x \equiv 18^{2019} \, \text{mod} \, 5 \\ 2019x \equiv 18^{2019} \, \text{mod} \, 9 \end{cases}
We know that $2019x \, mod \, 5 = 4x $ and $2019x \, mod \, 9 = 3x $. So we get:
\begin{cases} 4x \equiv 1 \, \text{mod} \, 5 \\ 3x \equiv 0 \, \text{mod} \, 9 \end{cases}. We can now multiply by the inverses. So we get:
\begin{cases} x \equiv 4 \, \text{mod} \, 5 \\ x \equiv 0 \, \text{mod} \, 3 \end{cases}. The last step will be here to use the Chinese Remainder theorem. I'm asking if my method is correct because it is the first time I'm practicing this kind of questions and I want to be sure.

Thanks in advance!

Best Answer

The method is correct but it should be $\!\bmod 5\!:\ {-}x\equiv 4x\equiv \color{#c00}2,\,$ so $\,x\equiv -2\equiv 3,\,$ and also $\,x\equiv 0\equiv 3\pmod{\!3} \iff x\equiv 3\pmod{\!15}\,$ by LCM or CCRT = Constant case CRT.

Related Question