Geometry Solver
Home › Counting and number theory

A short proof of Fermat's little theorem

Permute the nonzero residues

If is prime and does not divide , multiplying each nonzero residue modulo by produces the same residues in a different order. Their products are congruent and can be canceled.

Problem

Prove Fermat's little theorem: if is prime and integer is not divisible by , then leaves remainder 1 when divided by .

Answer

is congruent to modulo .
The condition that p does not divide a permits cancellation modulo p.

Step-by-step solution

1. Multiply all nonzero residues

Consider modulo . The residues of are all nonzero and distinct: if and were equal modulo , then would divide , forcing in the stated range.

2. Compare the products

The two lists are permutations of one another, so is congruent to modulo .

3. Cancel

None of the factors in is divisible by , so the product has a multiplicative inverse modulo . Canceling it gives the claimed congruence.

Add to Chrome - solve your own

Screenshot any problem on your screen and get the steps. Chrome on a computer; free.