Maths WorkshopMaths problems with full solutions
Exercise 1645Number theory › Divisibility and gcdL1Added 3 Nov 2026

Chinese remainder theorem

#Chinese remainder#congruences#CRT

Statement

State the Chinese remainder theorem and solve the system
{x≡2(mod5)x≡3(mod7)\begin{cases}x\equiv2\pmod5\\ x\equiv3\pmod7\end{cases}

Hint

Write x=2+5kx=2+5k and impose 2+5k≡3(mod7)2+5k\equiv3\pmod7.

Show solutionHide solution

Solution

Statement. If m1,…,mnm_1,\ldots,m_n are pairwise coprime, and a1,…,ana_1,\ldots,a_n are arbitrary integers, the system x≡ai(modmi)x\equiv a_i\pmod{m_i} has a unique solution modulo M=m1⋯mnM=m_1\cdots m_n.

Solve. x=2+5kx=2+5k. Need 2+5k≡3(mod7)2+5k\equiv3\pmod7, i.e. 5k≡1(mod7)5k\equiv1\pmod7. Since 5−1≡3(mod7)5^{-1}\equiv3\pmod7 (as 5⋅3=15≡15\cdot3=15\equiv1), k≡3(mod7)k\equiv3\pmod7, so k=3+7mk=3+7m. Then x=2+5(3+7m)=17+35mx=2+5(3+7m)=17+35m.

Conclusion. x≡17(mod35)x\equiv17\pmod{35}. Check: 17=3⋅5+217=3\cdot5+2, 17=2⋅7+317=2\cdot7+3. Correct.