How Fermat discovered his theorem.

I refer my reader to André Weil (Section 4, Chapter 2, of his Number Theory) or Harold Edwards (Section 1, Chapter 1, of his Fermat's Last Theorem).

Fermat's discovery of his little theorem was a direct outcome of his investigations concerning Euclid's theorem on perfect numbers. More specifically it originated from his investigations into the question of the primality or otherwise of ( [Maple Math] ).

On occasion we say things to our students like : I'm not sure how such-and-such first happened, was discovered, but I think it happened like this... For example, I find myself telling my students how I think Euclid could have discovered his famous theorem on perfect numbers. Also, many years ago, I used to (wrongly) tell how I thought Fermat had discovered his 'little' theorem... ; I thought he had found it by thinking about the decimal expansions of rational numbers. In Section 2 I consider decimal and other expansions, and there you will see how anyone could have formulated Fermat's little theorem had he/she simply asked the right questions having investigated decimal expansions of certain rational numbers.

Fermat was led to formulate his theorem via Euclid's theorem on perfect numbers:

if ( [Maple Math] ) is prime then [Maple Math] is perfect

One of my Maple delivered public lectures - The recently discovered record Mersenne prime (from 1995, and available at my web site) - treats the subject of abundant, deficient and perfect numbers, the Euclid theorem, etc - but here suffice it to say that before the mid 1450's it was believed that ( [Maple Math] ) is prime if and only if n itself is prime, a result blown away by the observation that:

[Maple Math] = 23*89 ... ( i )

Of course it is trivial that ( [Maple Math] ) is composite if n is composite, and so the real interest is in the Mersenne numbers { [Maple Math] }, where [Maple Math] , p prime. [Maple Math] is prime for [Maple Math] , ... , and is composite for [Maple Math] , ... Before Fermat (1640) nothing had been investigated beyond those p 's just shown, and it was Fermat who noted that:

[Maple Math] = [Maple Math] *178481 ... ( ii )

One would need to be incredibly numerically insensitive not to notice that '47' is so obviously related to '23':

[Maple Math] * [Maple Math]

Ones eye gets pulled back to the earlier ( i ) and notices exactly the same phenomenon :

[Maple Math] * [Maple Math]

But a great mistake for anyone to make, looking at this ab initio , would be to rush in and wonder/declare:

whenever [Maple Math] is composite, its least prime divisor q satisfies [Maple Math]

For see what happens with the next prime after 23:

> restart;

> p := 29;

[Maple Math]

> M[p] := 2^p - 1;

[Maple Math]

> ifactor(M[p]);

[Maple Math]

>

and so what did Fermat notice? Simply that not only is (returning to (i)) [Maple Math] * [Maple Math] , but also

[Maple Math] * [Maple Math]

and, with (ii), not only is (returning to (i)) [Maple Math] * [Maple Math] , but also

[Maple Math] * [Maple Math]

In short, one might say that Fermat discovered (then conjectured) what one might call the Fermat-Euler theorem on prime divisors of the Mersenne numbers: for prime p every prime divisor q of [Maple Math] satisfies:

[Maple Math] (mod p )

But it wasn't that alone that Fermat noticed, for he went one step further (he didn't have congruence terminology, but in that language this is what he observed):

One has [Maple Math] (mod 23), and so (squaring, cubing, etc) one has:

[Maple Math] etc (are all) = 1 (mod 23)

One has [Maple Math] (mod 89), and so (squaring, cubing, etc) one has:

[Maple Math] , ... , [Maple Math] etc (are all) = 1 (mod 89)

One also has (looking at case (ii)) [Maple Math] (mod 47), and so (squaring, cubing, etc) one has:

[Maple Math] etc (are all) = 1 (mod 47)

One also has (looking at case (ii)) [Maple Math] (mod 178481), and so (squaring, cubing, etc) one has:

[Maple Math] , ... , [Maple Math] , etc (are all) = 1 (mod 178481)

What I am trying to draw attention to is that for each of the above primes p one has [Maple Math] (mod p ) for various values of m , but that in all cases one of those m 's is ( [Maple Math] ).

In short, for the primes [Maple Math] one has

[Maple Math] (mod p )

But, is this true for other primes? Yes, of course it is (or appears to be), [Maple Math] , of course:

> for r to 15 do
[ithprime(r), 2^(ithprime(r)-1), 2^(ithprime(r)-1) mod ithprime(r)]
od;
# the reason for the '0' in the 1st output is obvious:

[Maple Math]

[Maple Math]

[Maple Math]

[Maple Math]

[Maple Math]

[Maple Math]

[Maple Math]

[Maple Math]

[Maple Math]

[Maple Math]

[Maple Math]

[Maple Math]

[Maple Math]

[Maple Math]

[Maple Math]

>

And what about changing that '2' to [Maple Math] , etc?

> for r to 15 do
[ithprime(r), 3^(ithprime(r)-1), 3^(ithprime(r)-1) mod ithprime(r)]
od;
# the reason for the '0' in the 2nd output is obvious:

[Maple Math]

[Maple Math]

[Maple Math]

[Maple Math]

[Maple Math]

[Maple Math]

[Maple Math]

[Maple Math]

[Maple Math]

[Maple Math]

[Maple Math]

[Maple Math]

[Maple Math]

[Maple Math]

[Maple Math]

etc. In short, one comes to suspect that [Maple Math] (mod p ) providing, of course, that [Maple Math] (mod p ), namely Fermat's little theorem .

Contact details 

After August 31st 2007 please use the following Gmail address: jbcosgrave at gmail.com


This page was last updated 18 February 2005 15:08:45 -0000