This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.1)

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