Nirmion
Pomoc Znajdź narzędzie

NUMBER THEORY / COMBINED RESIDUE SYSTEM

Chinese Remainder Two-Congruence Calculator

Combine two congruences with coprime moduli into one least nonnegative solution.

  • 01 Calculated in this tab
  • 02 Values stay in this browser tab
  • 03 Use boundary

Conversion input

Known value

Filter by unit name, symbol, or code. Your current selections remain available.

Preparing the calculator...

METHOD / WORKED EXAMPLE

Verify one solution against both congruences

The two-congruence theorem combines separate repeating residue conditions into one repeating solution class when the moduli are coprime. Both returned residues remain visible as the decisive check.

WORKED DEFAULT

Check the calculation with the default inputs

For x congruent to 2 modulo 3 and x congruent to 3 modulo 5, the least solution is 8. Every solution is 8 plus a multiple of 15.

  1. State both conditionsx = 2 mod 3; x = 3 mod 5
  2. Combine coprime periodsCombined modulus = 3 x 5 = 15
  3. Verify the solution8 mod 3 = 2; 8 mod 5 = 3

READ THE RESULT

Interpret the output in context

The least result is one representative of an infinite class modulo the product. A failure for shared-factor moduli does not prove inconsistency; it means this coprime-only workflow is insufficient.

ASSUMPTIONS AND LIMITS

Know where the model stops

  • Residues and moduli are safe integers.
  • Both moduli exceed one and are coprime.
  • The desired output is the least nonnegative representative.

This page handles two coprime moduli only. Compatible non-coprime systems require a generalized CRT solver with additional consistency checks.

COMMON QUESTIONS

Chinese Remainder Two-Congruence Calculator FAQs

Why is the solution unique only modulo 15?

The two coprime residue patterns repeat together after the product of their moduli, here 3 x 5 = 15. Therefore 8, 23, 38, and every value 8 + 15k satisfy the same pair of congruences. Reporting the least nonnegative representative gives a canonical answer without discarding the full solution class.

What if the two moduli are not coprime?

A solution may still exist if the residue difference is divisible by the moduli's greatest common divisor, but the combined period becomes their least common multiple rather than their product. This page intentionally rejects that case instead of silently applying the coprime formula. Use a generalized CRT method with an explicit compatibility check.

How do the verification residues confirm the result?

Substitute the returned solution into each original modulus. Its remainder must equal the corresponding normalized input residue. Both checks are necessary: satisfying only one congruence does not solve the system. The combined-modulus statement then describes every equivalent solution, while the displayed result is simply the least nonnegative member of that class.

Use boundary

Calculation path

Normalize both residues, invert the first modulus modulo the second, solve the required step count, and verify both residues in the combined modulus.

Calculation path

Combine x = a (mod m) and x = b (mod n); for coprime m,n the solution is unique modulo mn.