2.5.11 · D1Number Theory (Intermediate)

Foundations — Fermat's little theorem (statement)

1,831 words8 min readBack to topic

Before you can believe the theorem, you must be able to read it. Every symbol below is built in an order where each one only uses ideas already defined.


1. Counting numbers and division-with-remainder

Everything starts with the whole numbers and one very old idea: sharing into equal groups leaves a leftover.

Figure — Fermat's little theorem (statement)

Look at the figure: pebbles in rows of give full rows () and left over (), matching . The remainder is the only part we will care about from here on.


2. The symbol — "just the remainder"

Why does the topic need this? Fermat's theorem is entirely a statement about remainders. We never care that is big; we care only that . The symbol throws away the bulky quotient and keeps the one digit that matters.


3. The clock picture and the symbol (congruence)

Here is the single most important picture in all of modular arithmetic.

Figure — Fermat's little theorem (statement)

Why the topic needs it: the theorem's conclusion is a congruence, not an equation. It says the giant number lands on the "" mark of the -hour clock.

See Modular Arithmetic Basics for the full arithmetic (adding and multiplying on the clock).


4. The divides symbols and

The theorem's condition means " is not a multiple of ", which on the clock means " does not sit on the mark". That non-zero starting position is exactly what makes the magic possible — a starting hand parked at would just stay at forever.


5. Prime numbers

Figure — Fermat's little theorem (statement)

Look at the figure: pebbles can form a neat rectangle — it factors, so it is composite. pebbles refuse every rectangle except the flat line — that stubbornness is primality.

Why the topic needs primes specifically: on a -hour clock with prime, multiplying by any non-zero number shuffles the marks without ever collapsing two of them together. On a composite clock (like hours) that shuffle breaks — which is exactly why the parent's counterexample fails the theorem. More at Properties of Prime Numbers.


6. The greatest common divisor and "coprime"

For a prime , saying is the same as saying — because the only divisors of are and , so the only way to share a factor with is to be a multiple of . That is why the parent lists them as equivalent conditions.


7. Powers

Why the topic needs it: the theorem is about repeated multiplication on the clock. Fermat's claim is that after exactly such multiplications, the hour hand returns to the mark.


8. The factorial

The intuitive proof-sketch in the parent uses one more symbol.

Why the topic needs it: the "multiply every element on both sides" trick collects the numbers into one product, and that product is . Because is prime, none of share a factor with , so is coprime to and can be cancelled — leaving . (Its own remainder mod is the subject of Wilson's Theorem.)


How these foundations feed the theorem

Whole numbers and division with remainder

mod: keep the remainder

Congruence: same clock mark

Divides and does-not-divide

Prime numbers

gcd and coprime

Powers: repeated multiply

Factorial of p minus 1

Fermat Little Theorem

Read top to bottom: division-with-remainder is the seed; from it grow , congruence, and the divides relation; primes and coprimality branch off; powers and the factorial are the machinery; all of them converge on the theorem statement.


Where this leads next

  • Multiplicative Group Modulo Prime — the shuffle of under multiplication, made rigorous.
  • Euler's Totient Function — what replaces when the clock is composite.
  • Modular Exponentiation Algorithms — how to compute without ever writing the giant number.
  • Carmichael Numbers — composites that fake the theorem for every base.
  • RSA Cryptosystem — the payoff that made this theorem famous.

Equipment checklist

Cover the right side and see if you can state each from memory.

What does give you?
The remainder when is divided by , where .
What does mean?
and leave the same remainder mod — they sit on the same mark of the -hour clock (equivalently ).
How is different from ?
compares clock positions modulo , not actual values; the tag is essential.
What does mean?
does not divide exactly; is not a multiple of ; is off the mark.
What is a prime number?
A whole number whose only exact divisors are and itself.
What does (coprime) mean?
and share no common factor bigger than .
Why is "" the same as "" when is prime?
Because 's only divisors are and , the only way to share a factor with is to be a multiple of .
What does mean?
multiplied by itself times.
What is ?
The product of all the non-zero clock marks.
State Fermat's Little Theorem using these symbols.
For prime and , .