Chinese remainder theorem for non-prime / non-coprime moduli If I want to find some number $x$ where it leaves a remainder when divided by some prime $p$, and another remainder when divided by some prime $q$, and so on, I can use the Chinese Remainder Theorem.
However, what about when $p$ and $q$ are not prime nor coprime? 
 A: To use your example, trying to solve:
$$x\equiv 10\pmod{24}\\x\equiv 18\pmod{64}$$
You take each in terms of its prime factors:
$$x\equiv 10\pmod {3}\\
x\equiv 10\pmod{8}\\x\equiv 18\pmod {64}
$$
Note that $x\equiv{18}\pmod {64}$ implies $x\equiv 10\pmod 8$, so we are left with:
$$x\equiv 10\pmod {3}\\x\equiv 18\pmod {64}$$
which is a pair of equations with coprime moduli.
You can always do this. Prime factorization is hard, however, so if you wanted an algorithm, you'd want to come up with a more general way than just prime-factorization. There are ways, but I'd have to call them up from memory. But the general gist is that you need to always reduce the problem to the co-prime case, and some way to check for contradictions that rule out solutions.
A: The general result is the following:
The system of congruences $ x\equiv a_i  \mod{m_i} \quad(i=1,\dots,r) $ has a solution  if and only if for each pair $(i,j)$, $\,\, a_i\equiv a_j \mod{m_i\wedge m_j} $. The solution is unique modulo $\mathrm{lcm}(m_1, \dots, m_r) $.
