Explore residues and unknown exponents with confidence. Get verified solutions, tables, graphs, and exports instantly. Built for modular arithmetic analysis, learning, checking, and reporting.
Use the form below to solve ax ≡ b (mod m), compare methods, and inspect modular residue patterns.
| Base a | Target b | Modulus m | Equation | Expected smallest x |
|---|---|---|---|---|
| 2 | 5 | 11 | 2x ≡ 5 (mod 11) | 4 |
| 3 | 13 | 17 | 3x ≡ 13 (mod 17) | 4 |
| 5 | 8 | 23 | 5x ≡ 8 (mod 23) | 6 |
| 10 | 4 | 21 | 10x ≡ 4 (mod 21) | 2 |
This calculator solves the discrete logarithm problem in modular arithmetic. You enter a base a, a target residue b, and a modulus m. The goal is to recover the exponent x.
In practical terms, the calculator uses an extended baby-step giant-step approach for harder cases and can switch to brute force when the chosen range is small enough for direct checking.
Tip: Use a smaller preview range for quick inspection, and use the extended method for larger moduli.
It solves equations of the form ax ≡ b (mod m). The output is the smallest nonnegative exponent x when a valid solution exists.
A solution may not exist when the residue b is outside the powers generated by a modulo m. Gcd reductions can also prove impossibility early.
Brute force checks powers one by one. Baby-step giant-step stores partial results and searches more efficiently, often reducing work to about the square root of the modulus.
No. Prime moduli are common, but this page can also handle many composite cases using an extended reduction stage before the main matching step.
It shows whether the base and modulus are coprime. When gcd(a, m) = 1, the modular inverse exists and the main baby-step giant-step stage works directly.
The graph helps you inspect the residue cycle ax mod m. It makes repeating patterns and target hits easier to see during learning or verification.
It limits brute-force exploration and preview hit reporting. Higher values can reveal more repeated matches, but they also increase direct computation time.
Yes. Use the CSV button for structured data and the PDF button for a printable report containing the result summary and residue information.
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.