Math

Chinese Remainder Theorem Calculator

Solve x ≡ a (mod m) and x ≡ b (mod n) for coprime moduli.

Parameters Live Compute
Calculated Output
Smallest solution x 8
Combined modulus (m·n) 15
Formula: x ≡ a (mod m), x ≡ b (mod n), gcd(m,n)=1
Step-by-Step Breakdown
1. Values used:
2. Remainder a = 2
3. Modulus m = 3
4. Remainder b = 3
5. Modulus n = 5
6.
7. Smallest solution x = 8
8. Combined modulus (m·n) = 15
Did this calculator solve your problem today?
Report issue to loopingon.com
Sponsored

The Chinese Remainder Theorem combines two modular conditions into a single one when the moduli are coprime.

The math behind it

If gcd(m, n) = 1, there is exactly one solution modulo m·n. This tool searches that range for the smallest non-negative x.

Worked Example

x ≡ 2 (mod 3) and x ≡ 3 (mod 5) → x = 8 (mod 15).

Frequently Asked Questions

What if the moduli share a factor?

The theorem's uniqueness no longer applies; a solution exists only if the remainders are consistent.

Advertisement