With congruence, modular arithmetic, inverses, and CRT in place, we are ready for a major theorem about powers modulo a prime.
What this post covers
- The statement of Fermat's little theorem
- The two common forms of the theorem
- Power-reduction examples
- The importance of the prime-modulus condition
Key terms
- Fermat's little theorem: the theorem that says
a^{p-1} \equiv 1 \pmod pwhenpis prime andpdoes not dividea - prime number: a natural number greater than 1 with only two positive divisors
- congruence: equality of remainder classes
- Euler's theorem: the general coprime version of Fermat's theorem
The theorem
If p is prime and p does not divide a, then
A closely related version is
For beginners, it helps to remember the distinction:
a^{p-1} \equiv 1 \pmod prequiresp \nmid aa^p \equiv a \pmod pis the all-integer version
So the second form is often easier to remember globally, while the first form is often the one used for power reduction when a is coprime to p.
Example 1: 3^{100} \pmod 7
Since 7 is prime,
Now
so
Example 2: 2^{30} \pmod 5
Since 5 is prime,
And
so
Why do the conditions matter?
Fermat's little theorem is not a theorem for every modulus.
- the modulus must be prime
- for the
a^{p-1}form,amust not be divisible byp
If the modulus is composite, we need a more general framework. That is where Euler's theorem enters.
Common mistakes
1. Using the theorem with a composite modulus
The standard theorem is about prime moduli.
2. Forgetting the condition p \nmid a
That condition matters for the a^{p-1} form.
3. Reducing the exponent but making an arithmetic mistake at the end
The final small power still needs to be computed carefully.
Wrap-up
Fermat's little theorem reduces large exponents modulo a prime by revealing a repeating structure in powers.
Next we generalize this from prime moduli to arbitrary moduli with Euler's totient function and Euler's theorem.
💬 댓글
이 글에 대한 의견을 남겨주세요