Number Theory

Fermat’s Little Theorem

Fermat’s little theorem states that if p is prime and p does not divide a, then a^(p−1) ≡ 1 mod p.

Meaning

What Is Fermat’s Little Theorem?

Fermat’s little theorem states that if p is prime and p does not divide a, then a^(p−1) ≡ 1 mod p.

Fermat’s little theorem states that if p is prime and p does not divide a, then a^(p−1) ≡ 1 mod p.

Examples

Examples of Fermat’s Little Theorem

12⁶ ≡ 1 (mod 7).
Understand

Formula and Key Points

Formula / rule
a^(p−1) ≡ 1 (mod p)
  • Know the definition and standard notation for Fermat's Little Theorem.
  • Be able to recognise or compute fermat's little theorem in a small example.
  • Connect the concept to nearby topics in the same subject before using it in larger CSE problems.
CSE Connection

Why This Matters in Computer Science

Used in cryptography, hashing, coding theory, security protocols and efficient integer algorithms. Used in modular exponentiation, primality reasoning and public-key cryptography.

FAQ

Fermat’s Little Theorem: Frequently Asked Questions

What is Fermat's Little Theorem?

Fermat’s little theorem states that if p is prime and p does not divide a, then a^(p−1) ≡ 1 mod p.

Why is Fermat's Little Theorem useful in computer science?

Used in cryptography, hashing, coding theory, security protocols and efficient integer algorithms. Used in modular exponentiation, primality reasoning and public-key cryptography.