2.5.11 · D5Number Theory (Intermediate)
Question bank — Fermat's little theorem (statement)
Throughout, FLT = Fermat's Little Theorem, and means " does not divide ".

True or false — justify
Every prime satisfies for all integers .
False. It fails when : then , so . You need the coprimality condition (Form 1).
The alternative form needs .
False. That is Form 2's whole point — it holds for every integer , including multiples of , because both sides collapse to when .
If holds for one particular coprime to , that alone proves is prime.
False. A single base can pass by luck. Carmichael Numbers (like ) pass for all coprime bases yet are composite; passing is evidence, never proof, of primality.
If for some with , then is definitely composite.
True. This is the contrapositive of Form 1: a genuine prime must satisfy the congruence for every coprime base, so a single failure rules primality out completely.
is an instance of Fermat's Little Theorem.
False. is not prime, so FLT says nothing. (And in fact .) FLT's modulus must be prime.
For prime , the numbers each have a multiplicative inverse mod .
True. Since each is coprime to , Form 1 gives , so is the inverse. This is the Multiplicative Group Modulo Prime having every element invertible.
Raising to the power is the smallest exponent that always returns for coprime .
False — but the "smallest" depends on the base. Take the prime , so . The base already returns at the smaller exponent (since ), and is a divisor of . So always works, yet an individual base's true "order" can be a proper divisor of .
Spot the error
" by FLT, since and ." — find the flaw.
, so the coprimality condition fails and Form 1 does not apply. Correctly, , giving .
"To compute I use FLT: ." — what went wrong?
The exponent is wrong. Form 1 gives ; the exponent is , not . Using instead, the right statement is Form 2: .
" by FLT because ." — why is this nonsense?
The modulus is composite, so FLT is off the table entirely. The generalization for composite moduli uses Euler's Totient Function , and there , not — so the correct exponent isn't even .
"Since , we may cancel and conclude , so I'll just divide." — spot the sloppy step.
"Dividing" isn't a mod operation; you multiply by an inverse. The clean statement is , where is the element that multiplies to — it exists only because .
", so FLT works for ." — why is the conclusion illegitimate even though composites can accidentally satisfy such congruences?
is composite and , so nothing here is FLT; it's just an arithmetic coincidence (in fact , not ). A pattern matching the shape of FLT is never FLT unless the modulus is prime.
" because every number to the gives ." — where's the trap?
is a multiple of (it's ), so and the condition fails; . FLT's "every number" only means every number coprime to .
Why questions
Why does the theorem cancel in the intuitive derivation but this cancellation would be illegal for a composite modulus?
Cancellation needs to be invertible mod the modulus, i.e. coprime to it. For prime , none of shares a factor with , so is coprime. For a composite , some factor below divides , killing invertibility.
Why does multiplying by a coprime just permute the set rather than land two elements on the same value?
If then ; since and is prime, , forcing . So the map is injective on a finite set, hence a bijection — a permutation (this is exactly the shuffle in the figure above).
Why is (and not ) the natural exponent in Form 1?
There are exactly nonzero residues coprime to ; that count is the order of the Multiplicative Group Modulo Prime, and by Lagrange's theorem every element raised to the group order returns the identity .
Why does Form 2, , follow from Form 1 for coprime ?
Multiply Form 1 by : , i.e. . For non-coprime (a multiple of ) both sides are , so Form 2 still holds — that's why it's the "for all " version.
Why does FLT make computing modular inverses easy for prime moduli specifically?
Because is a closed formula for : . For composite you have no clean formula unless , and you'd use instead.
Why is FLT only a one-directional primality test?
Passing () is a necessary condition for primes but not sufficient — Carmichael Numbers pass for all coprime bases. Only failing is conclusive, ruling primality out. See Properties of Prime Numbers.
Edge cases
What does FLT say when ?
Trivially consistent: . It's a valid but uninformative instance — the theorem's content is in bases that aren't already .
What does FLT say when ?
. Since is even for every odd prime, , consistent with FLT. This quietly uses that all primes except are odd.
Does FLT apply when ?
Yes. For the only coprime residue is , and . Form 2 also holds: for every integer (eveneven, oddodd).
What happens if you plug a negative integer (with ) into FLT?
It still works — congruences depend only on residue classes. E.g. , matching , because and the theorem holds for every nonzero class.
Can the exponent ever be replaced by a smaller number that works for all coprime bases at once for prime ?
No smaller universal exponent exists for prime : some base (a "primitive root") has order exactly , so nothing below returns for that base. Individual bases may have smaller orders, but not all of them.
If but , is FLT still literally true?
Yes. FLT is a statement about residue classes, so the size of is irrelevant; reduce first if you like. E.g. .
Connections
- Fermat's little theorem (statement) — the parent statement these traps stress-test.
- Wilson's Theorem — the appearing above links to another prime signature.
- Modular Exponentiation Algorithms — where reducing exponents mod pays off.
- RSA Cryptosystem — the applied stakes of getting these conditions right.