Learn/Number Theory/Fermat's Little Theorem
Number Theory • Topic 18

Fermat's Little Theorem

Fermat's Little Theorem (FLT) is a specific case of Euler's Theorem for prime moduli. It is ubiquitous in primality testing and simplifying powers.

Statement

Theorem (Fermat's Little Theorem)
If is a prime number and is an integer not divisible by :

Alternatively, for any integer :

Applications

1. Computing Inverses

is the modular inverse of modulo .

2. Reducing Large Exponents

To compute , we can reduce the exponent modulo .

Practice Problems

Exercise (Problem 1)
Compute .
Exercise (Problem 2)
Show that is divisible by for all integers . (Hint: . Use FLT for each prime).
Exercise (Problem 3)
Find all primes such that divides .