Modular Exponentiation Solver
Modular Exponentiation Solver calculates \\( a^b \mod m \\) efficiently using the square-and-multiply algorithm and visualizes results for varying bases or exponents.
Modular Exponentiation Overview
Modular exponentiation computes \\( a^b \mod m \\), where \\( a \\) is the base, \\( b \\) is the exponent, and \\( m \\) is the modulus. It is widely used in cryptography (e.g., RSA) and number theory.
Formula: \\( a^b \mod m \\)
The calculation is performed efficiently using the square-and-multiply algorithm to handle large exponents.
Where:
- \\( a \\): Base (integer)
- \\( b \\): Exponent (non-negative integer)
- \\( m \\): Modulus (positive integer)
Example Calculations
Example 1: Small Numbers
\\( a = 2 \\), \\( b = 10 \\), \\( m = 100 \\)
Result: \\( 2^{10} \mod 100 = 1024 \mod 100 = 24 \\)
Example 2: Cryptographic Range
\\( a = 7 \\), \\( b = 256 \\), \\( m = 13 \\)
Result: \\( 7^{256} \mod 13 = 9 \\) (computed via square-and-multiply)
Example 3: Large Modulus
\\( a = 5 \\), \\( b = 20 \\), \\( m = 1000 \\)
Result: \\( 5^{20} \mod 1000 = 953125 \mod 1000 = 125 \\)
Example 4: Edge Case
\\( a = 3 \\), \\( b = 0 \\), \\( m = 17 \\)
Result: \\( 3^0 \mod 17 = 1 \mod 17 = 1 \\)