The Chinese Remainder Theorem (CRT) says that a system of congruences with pairwise coprime moduli always has a solution, and that solution is unique modulo the product of the moduli:
has a unique solution modulo (given the are pairwise coprime).
The practical method
You rarely need the general CRT formula on a contest — it’s usually faster to solve incrementally: take the first congruence, and among the numbers satisfying it, substitute into the second congruence to narrow down further, repeating until all conditions are satisfied.
Worked example
Problem: Find the smallest positive integer such that and .
Solution: Numbers satisfying : (each is ). Test these against the second condition :
So works. By CRT, since , the full solution set is — every 15th integer after 8 also works.
Practice problems
1.Find the smallest positive integer with and .
2.Given and , find the general solution modulo .
3.Find the smallest positive integer satisfying , , and .
4.Why does CRT require the moduli to be pairwise coprime?