Chinese Remainder Theorem Calculator – Guide & Formulas
Solve systems of simultaneous congruences using the Chinese Remainder Theorem. Find the smallest non-negative solution with step-by-step verification.
Try the free calculator
Put these formulas into practice with our instant, step-by-step Chinese Remainder Theorem Calculator.
Solve systems of simultaneous congruences using the Chinese Remainder Theorem. Enter your remainders and moduli to find the smallest non-negative integer satisfying all conditions.
Key Takeaway
Use the free Chinese Remainder Theorem Calculator to solve systems of simultaneous congruences using the chinese remainder theorem. find the smallest non-negative solution with step-by-step verification. Get instant results with step-by-step explanations.
How to Use the Chinese Remainder Theorem Calculator
- Enter the number of congruences in your system (2 or more).
- For each congruence, enter the remainder (aᵢ) and the modulus (nᵢ).
- Ensure all moduli are pairwise coprime (GCD of any two moduli = 1) for a unique solution.
- Review the solution x, the step-by-step computation, and the verification showing x ≡ aᵢ (mod nᵢ) for each equation.
The Formula
Variable Definitions
- aᵢ: The remainder for the i-th congruence
- nᵢ: The modulus for the i-th congruence (must be pairwise coprime)
- N: The product of all moduli: N = n₁ × n₂ × ... × nₖ
- Mᵢ: The partial product: Mᵢ = N / nᵢ
- yᵢ: The modular inverse of Mᵢ modulo nᵢ, satisfying Mᵢ × yᵢ ≡ 1 (mod nᵢ)
Solving x ≡ 2 (mod 3), x ≡ 3 (mod 5), x ≡ 2 (mod 7)
Find the smallest non-negative x satisfying all three congruences.
- Step 1: Identify N = 3 × 5 × 7 = 105.
- Step 2: Compute partial products: M₁ = 105/3 = 35, M₂ = 105/5 = 21, M₃ = 105/7 = 15.
- Step 3: Find modular inverses: 35⁻¹ mod 3 = 2 (since 35×2=70≡1 mod 3), 21⁻¹ mod 5 = 1 (since 21×1=21≡1 mod 5), 15⁻¹ mod 7 = 1 (since 15×1=15≡1 mod 7).
- Step 4: Compute x = (2×35×2 + 3×21×1 + 2×15×1) mod 105 = (140 + 63 + 30) mod 105 = 233 mod 105 = 23.
- Step 5: Verify: 23 mod 3 = 2 —, 23 mod 5 = 3 —, 23 mod 7 = 2 —. The solution is x = 23.