Advanced Congruence Relation Calculator

Analyze modular equality with detailed steps and clean visuals. Test classes, remainders, and inverses confidently. Understand equivalence rules through examples, exports, charts, and checks.

Calculator Inputs

Use integers only. The modulus is converted to a positive value automatically.

Formula Used

Core congruence test:
a ≡ b (mod n) if and only if n divides (a − b).
Equivalent form:
a ≡ b (mod n) if and only if a − b = kn for some integer k.
Residue reduction:
r = a mod n, where 0 ≤ r < n.
Residue class:
[a] = { a + kn | k ∈ ℤ }.
Modular inverse condition:
a has an inverse modulo n only when gcd(a, n) = 1.

The calculator also checks addition, multiplication, and exponent comparisons after modular reduction. These extra checks help verify how the relation behaves under common algebraic operations.

How to Use This Calculator

  1. Enter integer A and integer B.
  2. Enter a non-zero modulus n.
  3. Optionally enter value C to test shifted and scaled comparisons.
  4. Enter exponent e to compare powers under the same modulus.
  5. Choose how many residue class sample values you want displayed.
  6. Press Calculate Congruence.
  7. Review the summary, detailed table, class samples, and graph.
  8. Use the CSV or PDF buttons to export the results.

Example Data Table

A B n A mod n B mod n Congruent?
35 11 12 11 11 Yes
42 15 9 6 6 Yes
29 10 7 1 3 No

These examples show how equal residues imply congruence, while different residues place values into different equivalence classes.

FAQs

1) What does congruent modulo n mean?

It means two integers leave the same remainder after division by n. Equivalently, their difference is a multiple of the modulus.

2) Why must the modulus be non-zero?

Modulo zero is undefined because division by zero is undefined. A valid congruence relation needs a positive modulus size.

3) Can negative integers be used?

Yes. The calculator normalizes negative values into standard residues between 0 and n−1, so the comparison still works correctly.

4) What is a residue class?

A residue class is the full set of integers congruent to a chosen number under the same modulus. All members behave identically modulo n.

5) When does a modular inverse exist?

An inverse exists only when the number and the modulus are coprime. That means their greatest common divisor must equal 1.

6) Why test addition and multiplication with C?

These checks show how congruence behaves after shifting or scaling values. They are useful when studying modular arithmetic rules and proofs.

7) What does the quotient k represent?

If A − B = kn, then k is the integer multiplier proving divisibility. It exists only when the congruence statement is true.

8) What does the graph show?

It plots sample members from both residue classes. Matching classes overlap, while different classes stay separated by the modulus structure.

Related Calculators

direct product calculatorlocalization calculatordirect sum calculatorquotient ring calculatorprincipal ideal generator

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.