★ Fermat's Little Theorem [00I7]

If you play around a bit with arithmetic modulo p, one natural question you might end up asking is: if I start with some number a and keep multiplying a by itself (reducing modulo p every time), will I ever reach 1? If so, how many times do I have to multiply by a before reaching 1? If you did this when p is a prime, you would quickly notice that you always seem to reach 1 eventually, and that the number of iterations needed is always a divisor of p-1. This leads us to:

Context

Number Theory [00D3]

Related

Advanced/optional material [advanced]