Apply Fermat's Little Theorem to compute a^(p-1) mod p, or find a^k mod p for any exponent k using repeated modular reduction.
Enter your values below
How this calculator works
If p is prime and a is not divisible by p, then a raised to the power (p-1) leaves a remainder of 1 when divided by p.
Common questions about this calculator