How do I find a number x if I know that x mod a = b, x mod c = d and so on? The actual question is if there is a number x, and x mod 19 = 1, x mod 12 = 1 and x  mod 17 = 14, what is the number? I can solve this by using kinda brute force way. 19 * 12 * n + 1 = x, n is an integer, I tried from n = 1 until when n = 14, x mod 17 = 14. So the number is 3193. But I am just wondering if it is possible to do it in a more concise way, or there could be multiple answers to the question.
 A: From $x \equiv 1 \pmod {19}$ and $x\equiv 1 \pmod {12},$ it follows that $x\equiv1 \pmod {19\times12=228}$, 
so $x=228k+1.$ 
We also have $x\equiv14\pmod{17}$, so $228k+1\equiv14\pmod{17}$; i.e., $7k\equiv13\pmod{17}$.
Multiply both sides by $5 (5\times7\equiv1\pmod{17})$ to get $k\equiv65\equiv14\pmod{17}$.  
$228\times(14+17n)+1=\color{red}{3193}+3876n$.
A: $\!\!\bmod \color{#c00}{17}\!:\ {-}3 \equiv x \equiv 1\!+\!\overbrace{12\cdot 19}^{\large-5\ \,\cdot\,\ 2\, \ \ }\color{#c00}k \equiv  1\!+\!7k\!\iff\!  \color{#c00}k \equiv  \dfrac{-4}7 \equiv \dfrac{ -21}7 \equiv-3\equiv \color{#c00}{14}$
Hence we have $\ \ x = 1\!+\!12\cdot 19(\color{#c00}{14\!+\!17}n)) = \underbrace{1\!+\!12(19)14}_{\large 3193} + 12(19)17n^{\phantom{1^1}}\!$
A: You can use Bezout coefficients,  as one way of applying the Chinese remainder theorem. 
Let's take $x\cong1\pmod{19}$ and $x\cong1\pmod{12}$.
Note that $7\cdot19-12\cdot 11=1$.  Thus $7$ and $-11$ are Bezout coefficients for $19$ and $12$.  They can be found using the extended Euclidean algorithm,  for instance. 
As it turns out, $1\cdot 7\cdot 19+1\cdot {-12}\cdot 11=1$ will be the solution to the system mod $12\cdot 19=228$.
Next, Bezout coefficients for $17$ and $228$ are needed.  They are:  $-67$ and $5$.
Thus, we get $1\cdot-67\cdot 17+14\cdot 5\cdot 228=14821$.
And finally,  $14821\cong3193\pmod{12\cdot 17\cdot 19}$.
(Above I have simply applied repeatedly the fact that, when we have the system $\begin {cases} x\cong m_1\pmod{n_1}\\x\cong m_2\pmod{n_2}\end{cases}$, and $an_1+bn_2=1$,then $x=m_2an_1+m_1bn_2$ is a solution.
This comes from the existence part of the proof of CRT.)  
