Fermat’s Little Theorem Calculator
This calculator helps you verify Fermat’s Little Theorem or compute modular exponentiation based on it. It’s useful in number theory, cryptography (like RSA), and math competitions. Enter a base number and a prime modulus to see if the theorem holds.
Check Fermat’s Theorem or Compute Modulo Powers
Fermat’s Little Theorem Formula
Explanation:
Fermat’s Little Theorem states that if $$p$$ is a prime number and a is any integer not divisible by $$p$$, then $$a^{p-1} \mod p = 1$$. It is often used in modular arithmetic and cryptographic algorithms.
Fermat’s Theorem – Calculation Example
Let
$$a = 3,\quad p = 7$$
Check
- $$a^{p – 1} \mod p = 3^{7 – 1} \mod 7 = 3^6 \mod 7$$
- $$3^6 = 729,\quad 729 \mod 7 = 1$$
Result:
$$\Rightarrow\ 3^6 \equiv 1 \pmod{7} \quad \text{✓ Fermat’s Little Theorem holds}$$
Fermat’s Little Theorem is fundamental in number theory and is commonly used to simplify calculations in modular arithmetic, primality testing, and cryptographic systems. This calculator helps verify results or compute modular powers efficiently using this property.