Modular Arithmetic Equation Guide
What This Calculator Does
Modular arithmetic compares numbers by remainder. Two values are congruent when their difference is divisible by the modulus. This calculator focuses on that idea. It solves linear congruences, finds inverses, reduces residues, evaluates powers, and combines two congruences using the Chinese remainder method. It also gives each result with readable working, so students can follow the logic.
Why Modulus Matters
The modulus sets the repeating cycle. For modulus 7, every integer belongs to one of seven residue classes. Large numbers become easier because only the remainder matters. This is useful in clocks, calendars, coding theory, cryptography, random number checks, and contest mathematics. A correct modulus must be positive. A zero or negative modulus has no valid standard remainder system here.
Solving Linear Congruences
A linear congruence has the form ax congruent to b modulo n. It may have no solution, one reduced solution, or several related solutions. The key test is gcd(a, n) divides b. When the test passes, the equation is divided by that gcd. The reduced coefficient then needs a modular inverse. The calculator shows the base solution and all solutions within the original modulus.
Using Inverses and Powers
A modular inverse exists only when the number and modulus are coprime. The extended Euclidean algorithm finds that inverse. Modular powers are handled by repeated squaring. This keeps calculations controlled, because each multiplication is reduced by the modulus. The method is fast for normal educational inputs.
Working With Combined Congruences
The Chinese remainder option combines two remainder rules. It first checks whether their residues agree modulo the gcd of the moduli. If they do not agree, no common integer satisfies both rules. If they agree, the calculator returns the smallest nonnegative solution and the combined modulus.
Best Practice
Enter integers only. Use moderate sizes when your server has normal integer limits. Review the steps before using results in proofs. Export the table when you need a record for assignments, notes, or reports.
Interpreting Results
Results are shown as least nonnegative residues. Equivalent answers differ by a multiple of the final modulus. This keeps answers compact. It also makes comparison easier across examples, worksheets, and exported reports during careful later review.