Explore residue classes, congruence checks, inverses, and modular powers. See tables, graphs, and exportable results. Practice modular arithmetic faster with clear guided outputs today.
Enter values below to analyze a residue class, test congruence, perform modular operations, and generate exportable results.
| a | n | b | c | e | Normalized residue | Congruence check |
|---|---|---|---|---|---|---|
| 29 | 12 | 53 | 7 | 5 | 5 | 29 ≡ 53 (mod 12) |
| -17 | 9 | 1 | 4 | 3 | 1 | -17 ≡ 1 (mod 9) |
| 42 | 11 | 9 | 8 | 4 | 9 | 42 ≡ 9 (mod 11) |
| 35 | 8 | 3 | 6 | 2 | 3 | 35 ≡ 3 (mod 8) |
r = ((a mod n) + n) mod n
This keeps the residue inside the standard set {0, 1, 2, ..., n − 1}, even when a is negative.
a ≡ b (mod n) if and only if n | (a − b).
Equivalently, a and b are congruent when they share the same normalized residue modulo n.
[a]n = {a + kn : k ∈ ℤ}
Every number in the class differs from a by a multiple of n, so all representatives reduce to the same residue.
a-1 mod n exists only when gcd(a, n) = 1.
When it exists, the inverse x satisfies ax ≡ 1 (mod n).
ae mod n
The calculator uses repeated squaring, which is faster than multiplying a by itself e times.
[a] + [c] = [a + c], [a] − [c] = [a − c], and [a][c] = [ac] modulo n.
These operations are performed using the same modulus, then reduced to the standard residue range.
Enter the main integer a and a positive modulus n. These two values define the residue class you want to study.
Optionally enter b to test congruence with a, and c to perform modular addition, subtraction, and multiplication.
Set the exponent e for a power result, choose how many class representatives to display, and select graph points.
Click the calculate button. The result appears above the form, directly below the header, exactly as requested.
Review the summary table, class representatives, inverse information, power output, and the residue cycle graph.
Use the CSV and PDF buttons to export the result set for homework, teaching notes, or reference sheets.
A residue class groups all integers that leave the same remainder when divided by the same modulus. For example, 5, 17, and 29 belong to the same class modulo 12 because each reduces to residue 5.
Normalized residues stay within the standard range from 0 to n − 1. This makes comparisons easier, especially when the original number is negative or much larger than the modulus.
It means a and b differ by a multiple of n. Another way to say it is that both numbers reduce to the same residue after division by n.
Yes. The calculator accepts negative numbers and converts them into standard residues automatically. This is useful for algebra, number theory, and cryptography practice.
A modular inverse exists only when the integer and modulus are coprime. In practical terms, gcd(a, n) must equal 1. Otherwise, no multiplicative inverse exists modulo n.
The graph plots integers against their residues modulo n. It helps you see the repeating cycle of modular arithmetic and quickly understand periodic residue behavior.
A residue class contains infinitely many representatives. Showing nearby values such as r − 2n, r − n, r, r + n, and r + 2n makes the class pattern easier to understand.
The CSV file is convenient for spreadsheets and datasets. The PDF file is useful for handouts, notes, tutorials, assignment solutions, and record keeping.
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.