8.02l–8.02o - Fermat's little theorem and orders
Use both forms of Fermat's little theorem to reduce powers and prove divisibility, while keeping track of what the theorem does and does not establish. Find the order of a number modulo a prime, and use the binomial theorem to explain a powerful prime-modulus identity.
Fermat's theorem for coprime bases
Suppose leaves remainder one on division by . Does that prove is prime? Fermat's little theorem makes the test tempting; understanding its direction will save you from the trap.
Start with a genuine prime. Modulo seven, , so . Fermat's theorem guarantees a power giving one for every base coprime to a prime modulus, though the guaranteed exponent may not be the smallest.
You already know
You can reduce products and non-negative integer powers modulo a fixed integer. If a number is coprime to the modulus, it has a multiplicative inverse; Euclid's lemma permits cancellation from divisibility under the same coprimality condition.
The theorem's first form provides an exponent you can use immediately.
Fermat's little theorem: coprime form
If is prime and , then
Not in the formula booklet: learn it.
Use the theorem as a result: its proof is not needed here. If , with , then . Thus reduce the exponent modulo , after checking the two conditions.
Worked example 1: reducing an exponent
Question. Find the least non-negative residue of modulo thirteen.
Plan. Use Fermat's theorem to remove multiples of twelve from the exponent, then calculate the remaining small power.
Why this step? Thirteen is the modulus for residues, but twelve is the period supplied for the exponent. They have different jobs.
Answer. The residue is .
Check. , so , consistent with the theorem.
The next example changes only the exponent by one. Keep the small remainder power and one extra factor of seven.
Worked example 2: one extra factor
Question. Find the least non-negative residue of modulo thirteen.
Plan. Reduce the exponent modulo twelve and use the power already found.
Why this step? Increasing an exponent by one multiplies the residue by the base; it does not increase the residue by one.
Answer. The residue is .
Check. Multiplying the previous answer by seven gives .
The prime and coprimality conditions are part of a valid application.
Watch out
Wrong: by Fermat's theorem. The base and modulus are not coprime. Right: , because the power is a multiple of thirteen.
The same reduction works for a still larger exponent without calculating the full power.
Fermat's theorem for every integer
The second form includes bases divisible by the prime, so it is especially useful in statements about every integer.
Fermat's little theorem: unrestricted-base form
If is prime, then for every integer ,
Equivalently, .
Not in the formula booklet: learn it.
If , multiplying the first form by gives this form. If , both and are divisible by , so it still holds. Conversely, for a base coprime to , you can cancel using its inverse to recover the first form. This explains how the forms fit together, without proving the theorem itself.
For example, , so the second form handles precisely the boundary that prevented the first form from giving one.
Worked example 3: a divisibility statement for all integers
Question. Prove that for every integer .
Plan. Isolate the difference supplied by Fermat's theorem.
Why this step? The unrestricted-base form applies even when itself is divisible by eleven, so no exceptional case is left out.
Answer. The sum is congruent to zero modulo eleven for every integer ; therefore .
Check. At the expression is zero; at it is eleven. Both satisfy the conclusion.
The next example changes only the constant term. The same theorem now proves that divisibility is impossible.
Worked example 4: a constant changes the conclusion
Question. Determine whether can be divisible by eleven for any integer .
Plan. Reduce the first two terms using the previous argument, then retain the added constant.
Why this step? A theorem about a difference does not make an extra constant disappear; its residue decides the new question.
Answer. It is never divisible by eleven: its least non-negative residue is always one.
Check. At , the value is twelve, with remainder one.
For a universal statement, write the theorem in a form that covers every permitted base.
Watch out
Wrong: using for every integer . It fails when . Right: holds for every integer.
Change the prime and keep the added constant visible.
Why a passed test does not prove primality
Fermat's theorem gives a necessary property of primes, so failing the property can rule out primality; passing it need not establish primality.
For example, is coprime to two, but
If fifteen were prime, the first form of Fermat's theorem would give one, so this failure proves it composite.
Now examine the opening number:
The arithmetic test passes, but the number is still composite.
Pseudoprime to a base
A composite positive integer is a pseudoprime to base if and . Thus is a pseudoprime to base two. Fifteen is not a pseudoprime to base two.
The base is part of the description: passing for one base gives no claim about every other base. The implication and its failed converse are not in the formula booklet: learn the distinction.
Key idea
Prime modulus implies Fermat's congruence; Fermat's congruence alone does not imply prime modulus.
A factorisation settles compositeness even when a modular test happens to pass.
Continue this lesson.
You’re previewing NovaLearn without an account. Create a free account to read the rest.
Create free account