Maths matters :: The magic of prime clocks :: Euler's explanation  
         
     

Fermat's Little Theorem
Here is an explanation of Fermat's Little Theorem that Ap=A(modulo p) on a clock with a prime p number of hours on it. This may be too tough. It's not difficult but requires a little bit of that act of Buddhist mediation to stay focused.

We will show that if we multiply a number A which is not zero together p-1 times on this clock we get to 1 o'clock. This will suffice because multiplying 1 by A again must bring us to A. Remember A is not meant to be 0.

Make a list of all the hours possible, excluding 0, that is p-1 possibilities 1,2,…,p-1. Now write down the list but multiply each element on the list by A on our clock calculator, so we get Ax1,Ax2,…,Ax(p-1). Now I claim that the hours in this list are just the same as those in the original list 1,2,…,p-1 but in a different order.

If not then either one of the answers is 0 or two answers are the same. There isn't room for anything else to happen since there are only p hours on the clock. Suppose Axn and Axm give the same time on the p-hour clock. I'll show you why this means that n=m. So Axn-Axm=Ax(n-m) is zero on the clock calculator, i.e. Ax(n-m) on our ordinary calculator is divisible by p. Like a chemical the number Ax(n-m) is built from the atoms building A and the atoms building (n-m). Now we use that p is one of the atoms of arithmetic and can't be cracked any further. Because p divides Ax(n-m) it must be one of these atoms used to build Ax(n-m). Remember that there is only one way to build a number out of primes. But p doesn't divide A so it must be in the list of atoms used to build (n-m), i.e. (n-m) is divisible by p. But what does that mean - that n and m are the same time on our p hour clock.

You can use a similar argument to show that Axn can't be zero o'clock if neither A nor n are zero o'clock. Note that it is very important in all this that the clock has prime number of hours since we have seen already that 4x9 is zero on the 12 hour clock without either 4 or 9 being zero.

So we have two lists 1,2,…,p-1 and Ax1,Ax2, …,Ax(p-1) consisting of the same numbers but in a different order. Here is the nice trick which Fermat himself had probably discovered. If we multiply all the numbers on either list together we get the same answer because the order we multiply things in doesn't matter. The first list gives us 1x2x…x(p-1) which we write as (p-1)! called (p-1) factorial. The second list consists of A multiplied together p-1 times and again 1 to p-1 multiplied together. After a little rearrangement this gives us (p-1)!xAp-1. So these give the same answer on our clock calculator i.e.

(p-1)!= (p-1)!xAp-1 (modulo p)

This means that (p-1)!x(1-Ap-1) is divisible by p. Now we use the same trick as before. None of the numbers 1,…,p-1 is divisible by p so (p-1)! can't be divisible by p. So the only option is that (1- Ap-1) is divisible by p. This means that the calculation Ap-1 on the clock calculator always gives me the answer 1. Just what Fermat had teased his generation to explain.

There are several interesting ingredients in this argument. It is certainly important that if AxB is divisible by a prime p then one of A or B must also be divisible, something which follows from the special property of the primes that numbers have a unique set of prime building blocks. But the beautiful leap for me comes in seeing the same thing, this list of numbers 1,…,p-1, in two different ways. Lateral thinking at its best.

 
         

 

 
Home :: Prime importance :: $1,000,000 problem :: Maths matters :: The art of maths Copyright © 2003 Marcus du Sautoy