Congruence Equation System Solver Calculator

Enter congruences, reduce coefficients, and merge valid residues. See modular steps with compatibility diagnostics instantly. Use exports, examples, and FAQs for confident problem solving.

Calculator

Enter each row as a linear congruence of the form ax ≡ b (mod m).

Congruence 1

Congruence 2

Congruence 3

Example Data Table

Row a b m Original Congruence Reduced Form
1 2 4 6 2x ≡ 4 (mod 6) x ≡ 2 (mod 3)
2 3 9 15 3x ≡ 9 (mod 15) x ≡ 3 (mod 5)
3 1 5 7 x ≡ 5 (mod 7) x ≡ 5 (mod 7)
Combined solution: x ≡ 68 (mod 105)

Formula Used

Each row starts as ax ≡ b (mod m).

First compute g = gcd(a, m).

The row is solvable only when g divides b.

Then reduce the row to:

(a / g)x ≡ (b / g) (mod m / g)

Because gcd(a / g, m / g) = 1, the inverse exists.

The reduced residue becomes:

x ≡ (a / g)-1(b / g) (mod m / g)

To merge two reduced rows, use:

x ≡ r1 (mod m1) and x ≡ r2 (mod m2)

A common solution exists only when r1 ≡ r2 (mod gcd(m1, m2)).

The combined modulus is lcm(m1, m2) = m1m2 / gcd(m1, m2).

How to Use This Calculator

  1. Add one row for each congruence in your system.
  2. Enter integer values for a, b, and m.
  3. Use a non zero modulus in every row.
  4. Click Solve System to reduce and combine the rows.
  5. Read the reduced congruences table to see each modular step.
  6. Check the combination table to confirm how the final residue was built.
  7. Use the CSV button to export the tables.
  8. Use the PDF button to save the result as a clean document.

Congruence Equation System Solver Guide

Why this solver is useful

A congruence equation system solver helps you work with modular arithmetic in a direct way. Many problems in number theory, coding, cryptography, and puzzle design use congruences. Solving them by hand can be slow. Small sign mistakes also cause wrong residues. This calculator reduces each equation first. Then it checks whether the full system is compatible. That saves time and improves accuracy.

What the calculator actually does

Each row begins in the form ax ≡ b (mod m). The solver computes gcd(a, m) and checks divisibility. If the gcd does not divide b, that row has no solution. The whole system then fails. If the row is valid, the calculator divides through by the gcd. Next it finds a modular inverse. That converts the row into a simpler result x ≡ r (mod n). This reduced form is easier to combine with other rows.

How system combination works

After reduction, the calculator merges the congruences one by one. It uses the generalized Chinese Remainder Theorem. This version works even when moduli are not pairwise coprime. The solver checks residue agreement modulo the gcd of the moduli. If agreement fails, there is no common solution. If agreement holds, the tool builds one final residue and one final period. That result describes every integer solution in one compact formula.

Who can use it

Students can use this page to verify homework steps. Teachers can generate examples and export solution tables. Competitive exam learners can test fast modular reductions. Developers can also use it while building residue based algorithms. The example table, formula section, and FAQs make revision easier. Because the page shows reduced rows and combination steps, it works as both a calculator and a learning aid.

FAQs

1. What does this solver calculate?

It solves systems of linear congruences. Each row can be written as ax ≡ b (mod m). The tool reduces each row, checks compatibility, and returns the final repeating solution when one exists.

2. Can the moduli be non coprime?

Yes. The solver uses the generalized Chinese Remainder Theorem. It checks whether residues agree modulo the gcd of the moduli before combining them.

3. What happens if one row has no solution?

If gcd(a, m) does not divide b, that row is impossible. The calculator stops the system and reports that no complete solution exists.

4. Why does a row sometimes reduce to mod 1?

A modulus of 1 means the row places no real restriction on x. Every integer satisfies that reduced condition, so it does not change the combined solution.

5. Can I use negative numbers?

Yes. Negative coefficients and right sides are accepted. The solver normalizes residues into standard modular form before showing the final answer.

6. What does the final answer mean?

If the result is x ≡ r (mod n), every solution has the form x = r + nk, where k is any integer. That single expression represents all answers.

7. What does the CSV export contain?

The CSV file includes the original rows, reduced congruences, combination steps, and the final result. It is useful for records, notes, and worksheet preparation.

8. Is this useful for learning modular arithmetic?

Yes. The page shows gcd checks, row reduction, residue formation, and system merging. That makes it practical for both fast answers and step review.

Related Calculators

boolean algebra calculatorset operations calculatorbinary multiplication calculatorcode word generatorfibonacci sequence calculatorbinary subtraction calculatorbinary tree calculatorkarnaugh map calculatorbinary number calculatordivisibility calculator

Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.