Mathematica > Mathematics and Algorithms > Number Theory > Diophantine Equations >

ChineseRemainder

ChineseRemainder[{r1, r2, ...}, {m1, m2, ...}]
gives the smallest positive x that satisfies all the integer congruences x mod mi = ri mod mi.
  • If all ri<mi, then the result satisfies x mod mi = ri.
The smallest positive integer x that satisfies x mod 4=3 and x mod 5=4:
In[1]:=
Click for copyable input
Out[1]=
 
Find the smallest positive integer giving remainder 3,5,7 when divided by 2,3,5:
In[1]:=
Click for copyable input
Out[1]=
New in 6
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team