Modular Exponentiation Calculator
Calculate a^b mod m using fast exponentiation. Essential for cryptography and number theory.
Input
Common examples:
3^13 mod 7
3
Binary Representation of Exponent
13 = (1101)₂
4 bits
Euler's Totient
φ(7) = 6
If gcd(3, 7) = 1, then 3^6 ≡ 1 (mod 7)
Power Table
Square-and-Multiply Steps
Square-and-Multiply Algorithm
How It Works
Instead of multiplying b by itself e times, we use the binary representation of e. For each bit, we square the base. For each 1-bit, we also multiply into the result.
Complexity
Time: O(log e) multiplications instead of O(e). Critical for cryptography where e can have hundreds of digits.
Help us improve!
How would you rate the Modular Exponentiation Calculator?
Powiązane Kalkulatory
Editorial Note
MyCalcBuddy Editorial Team
This page is maintained as an educational calculator reference.
Formula Source: Handbook of Mathematical Functions
by Abramowitz & Stegun