Fermat’s Little Theorem Calculator
Fermat’s Little Theorem Calculator
How do we use Fermat’s Little Theorem to simplify calculations? Use our Fermat’s Little Theorem Calculator, that can helps you find results of modular arithmetic easily. Enter the base, prime, and optionally the exponent into the calculator to find the result.
How to Use the Calculator
To use the Fermat’s Little Theorem Calculator is easy. Follow these steps:
 Base (a): Enter a positive integer as the base.
 Example: 2
 Prime (p): Enter a prime number greater than 1.
 Example: 7
 Exponent (e): Enter a nonnegative integer as the exponent. This field is optional.
 Example: 3
After entering these values, press the “Calculate” button to see the result.
What is Fermat’s Little Theorem?
Fermat’s Little Theorem is a principle in number theory. It states that if p is a prime number and a is an integer not divisible by p, then:
${a}^{p1}\equiv 1\text{\hspace{0.17em}}(\text{mod}\text{\hspace{0.17em}}p)$
This means that ${a}^{p1}1$is divisible by p. It helps simplify calculations involving powers of integers modulo a prime number.
Formula
The formula used in Fermat’s Little Theorem is:
${a}^{p1}\equiv 1\text{\hspace{0.17em}}(\text{mod}\text{\hspace{0.17em}}p)$
If you have an exponent e, the result is:
${a}^{e}\text{\hspace{0.17em}}(\text{mod}\text{\hspace{0.17em}}p)$
Variables
Variable  Description 

Base (a)  The integer base 
Prime (p)  A prime number 
Exponent (e)  The nonnegative integer exponent (optional) 
Calculation Example
Example 1
 Base (a): 2
 Prime (p): 7
 Exponent (e): None
Calculation Steps:
Since no exponent is given, use Fermat’s Little Theorem directly:

 ${2}^{71}\equiv 1\text{\hspace{0.17em}}(\text{mod}\text{\hspace{0.17em}}7)$
 ${2}^{6}\equiv 1\text{\hspace{0.17em}}(\text{mod}\text{\hspace{0.17em}}7)$
Result:
 ${2}^{6}\text{\hspace{0.17em}}(\text{mod}\text{\hspace{0.17em}}7)=1$
Example 2
 Base (a): 3
 Prime (p): 11
 Exponent (e): 4
StepbyStep Calculation:
1. Use the given exponent directly:

 Calculate ${3}^{4}\text{\hspace{0.17em}}(\text{mod}\text{\hspace{0.17em}}11)$
2. Compute ${3}^{4}$
${3}^{4}=81$
3. Find the result modulo 11:

 $81\text{\hspace{0.17em}}(\text{mod}\text{\hspace{0.17em}}11)$
 $81\xf711=7$remainder $4$
 So, $81\equiv 4\text{\hspace{0.17em}}(\text{mod}\text{\hspace{0.17em}}11)$
Result:
 ${3}^{4}\text{\hspace{0.17em}}(\text{mod}\text{\hspace{0.17em}}11)=4$