Fermat’s Little Theorem Calculator

Fermat's Little Theorem Calculator - Multi-Tools

Fermat's Little Theorem Calculator

Must be a positive integer
Must be a prime number

Result

How to Use

  1. Enter a base number (a)
  2. Enter a prime number (p)
  3. Click "Calculate" to see the result
  4. The calculator will verify the theorem and show the calculation steps

What is Fermat's Little Theorem?

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) ≡ 1 (mod p)

Example: For a = 2 and p = 5:

2^(5-1) = 2^4 = 16 ≡ 1 (mod 5)

Properties and Applications

Property Description Application
Modular Exponentiation a^(p-1) ≡ 1 (mod p) Fast exponentiation
Prime Testing If a^(p-1) ≢ 1 (mod p), then p is not prime Probabilistic primality testing
Modular Multiplicative Inverse a^(p-2) ≡ a^(-1) (mod p) Finding modular inverses

Applications

  • Cryptography (RSA algorithm)
  • Primality testing
  • Modular arithmetic calculations
  • Number theory problems
  • Fast exponentiation algorithms
Advertisement Space
Scroll to Top