Everything rests on one line, so let us pin it down before we lean on it.
The figure above is our mental picture for the whole page: a clock with p hours. Multiplying by a just reshuffles the hour-marks 1,2,…,p−1, and after p−1 steps of a certain journey you always return to 1. Keep it in mind.
The exponent is now large and not a clean multiple of p−1. You must reduce it first.
Recall Solution 3.1
p=13 prime, gcd(7,13)=1, so 712≡1(mod13). We want to write 100 using multiples of 12:
100=12⋅8+4(since 12⋅8=96,100−96=4).
Then
7100=(712)8⋅74≡18⋅74=74(mod13).
Compute 72=49≡49−3⋅13=10(mod13), so 74=(72)2≡102=100≡100−7⋅13=9(mod13).
Answer:7100≡9(mod13).
Recall Solution 3.2
p=17 prime, so 216≡1(mod17). Reduce the exponent modulo 16:
1000=16⋅62+8(16⋅62=992,1000−992=8).
Hence 21000≡28(mod17). Now 28=256=15⋅17+1=255+1, so 256≡1(mod17).
Answer:21000≡1(mod17). (This "extra 1" is fine — it just means 2 has a smaller cycle, order 8, dividing 16.)
Recall Solution 3.3
Careful: gcd(6,3)=3=1, so Form 1 does not apply. But 6≡0(mod3), so
650≡050=0(mod3).
Every power of a multiple of p stays ≡0. Form 2 also confirms consistency: 63≡6≡0.
Answer:0.
Combine FLT with modular inverses and multi-step arguments.
Recall Solution 4.1
Since 3⋅3p−2=3p−1≡1, the inverse is 3p−2=39(mod11).
32=9, 34=81≡4, 38=(34)2≡42=16≡5. Then 39=38⋅3≡5⋅3=15≡4(mod11).
Check:3⋅4=12≡1(mod11). ✓
Answer:3−1≡4(mod11).
Recall Solution 4.2
Proof.p=7 is prime. Two cases:
If gcd(a,7)=1: Form 1 gives a6≡1, so a7=a⋅a6≡a⋅1=a.
If 7∣a: then a≡0, and a7≡0≡a.
Both cases give a7≡a(mod7). This covers all integers. ■Computation.10≡3(mod7), so 107≡37≡3(mod7) (by the identity just proved).
Answer:107≡3(mod7).
Recall Solution 4.3
First reduce the base: 23=3⋅7+2, so 23≡2(mod7). Now 2385≡285(mod7).
p=7, gcd(2,7)=1, so 26≡1. Reduce the exponent mod 6: 85=6⋅14+1, so
285=(26)14⋅21≡1⋅2=2(mod7).Answer:2385≡2(mod7).
Reason about where FLT stops working and how it is generalized.
Recall Solution 5.1
(a) FLT is a one-way statement: "p prime ⇒ap−1≡1." It says nothing about composite moduli. A composite n may accidentally satisfy an−1≡1(modn); here 341 does so for a=2. That's a coincidence permitted by the theorem, not a violation.
(b) The converse "an−1≡1(modn)⇒n prime" is what a naive test would use — and it is false. 341 is a counterexample (a Fermat pseudoprime to base 2). See Carmichael Numbers for composites that fool every base. Practically: passing the test proves nothing on its own; failing it (some coprime a with an−1≡1) does prove compositeness.
Answer: No contradiction; the converse is invalid, which is the whole reason single-base Fermat tests are unreliable.
Recall Solution 5.2
Take a=5 (and gcd(5,6)=1). 5≡−1(mod6), so 55≡(−1)5=−1≡5(mod6), which is not1.
So even with a coprime base, the classical exponent n−1=5 fails when n is composite. The correct exponent comes from Euler's theorem: ϕ(6)=2, and indeed 52=25≡1(mod6).
Answer:55≡5≡1(mod6); primality is essential.
Recall Solution 5.3
ϕ(15)=ϕ(3)ϕ(5)=2⋅4=8, and gcd(2,15)=1, so Euler guarantees 28≡1(mod15).
Check: 24=16≡1(mod15) already — the true order is 4, which divides the guaranteed 8 (orders always divide the guaranteed exponent). Using 24≡1:
100=4⋅25,2100=(24)25≡125=1(mod15).Answers: Euler guarantees 28≡1; and 2100≡1(mod15).
Recall One-page skill checklist (self-test)
Before applying the classical form: ☐ Is p prime? ☐ Is gcd(a,p)=1?
Reduce the base mod p ::: yes, always shrink a first
Reduce the exponent mod p−1 ::: only when gcd(a,p)=1; period is p−1
Exponent equals p−1 ::: answer is 1
Exponent equals p ::: answer is a (Form 2)
Modular inverse of a mod prime p ::: ap−2modp
Composite modulus n ::: use Euler with ϕ(n), not FLT