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

ChineseRemainder

ChineseRemainder
gives the smallest non-negative x that satisfies all the integer congruences x mod = mod .
  • If all , then the result satisfies x mod = .
The smallest positive integer x that satisfies and :
Find the smallest positive integer giving remainder when divided by :
The smallest positive integer x that satisfies and :
In[1]:=
Click for copyable input
Out[1]=
 
Find the smallest positive integer giving remainder when divided by :
In[1]:=
Click for copyable input
Out[1]=
Database encryption and decryption:
Key generation:
Encrypted data:
Decryption:
Define a residue number system:
Numbers and their representation in a residue system:
Multiplying and recovering in the residue system:
Adding and recovering:
Modular computation of a determinant:
Modular determinants:
Recover result:
Shift residue to be symmetric:
Solve congruential equations using Reduce or FindInstance:
Not all congruential equations have a solution:
A solution exists when Mod[ri, GCD[m1, m2, ...]]==Mod[rj, GCD[m1, m2, ...]]:
New in 6
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team
Format:   HTML  |  CDF