Chinese remainder theorem :Algebraic solution I need help in a question:
It is required to find the smallest $4$-digit number that when divided by $12,15$, and $18$ leaves remainders $8,11$, and $14$ respectively. Here's how I've attempted:
Let the number be $a$, then $$a=12p+8 = 15q+11 = 18r+14$$
Hence, $p=(5q+1)/2$ and $r=(5q-1)/6$
So, $a=15q+11$
Now if I put $q=67$, $a=1016$ (wrong answer because $r$ is not an integer) .
So where did I go wrong in the algebraic method?

Given:
$$x \equiv 8 \pmod{12} \Rightarrow x = 12a + 8 \\
x \equiv 11 \pmod{15} \Rightarrow x = 15b + 11\\
x \equiv 14 \pmod{18} \Rightarrow x = 18c + 14$$
We solve the equations pairwise:
$$1) \ 12a+8=15b+11 \Rightarrow 4a-5b=1 \Rightarrow \begin{cases}a=5n-1 \\ b=4n-1\end{cases}$$
$$2) \ 12a+8=18c+14 \Rightarrow 2a-3c=1 \Rightarrow \begin{cases}a=3m-1 \\ c=2m-1\end{cases}$$
Hence:
$$a=5n-1=3m-1 \Rightarrow a=15k-1.$$
Now we find possible values of $k$:
$$x=12a+8\ge 1000 \Rightarrow 12(15k-1)+8\ge 1000 \Rightarrow k\ge 5.6 \Rightarrow k=6.$$
Hence:
$$a=15\cdot 6-1=89 \Rightarrow x=12\cdot 89+8=1076.$$
