The Chinese reminder theorem for n congruences

x ≡ a1 (mod m1),..., x ≡ an (mod mn)

Here a1,...,an, m1,...,mn, are integers, with m1,...,mn positive.

The congruences are solved recursively, starting with the first two.

Enter a1,...,an (separated by spaces):
Enter m1,...,mn (separated by spaces):

Last modified 29th April 2004
Return to main page