> # Fermat.mws

Speaker : Dr. John Cosgrave.

Address : Mathematics Department, St. Patrick's College,

Drumcondra, Dublin 9, IRELAND.

e-mail : [email protected] (College) or
[email protected] (Home)

Web : <http://www.spd.dcu.ie/johnbcos>

Title of talk (given on Tuesday 10th. August 1999 in Plymouth University, Devon, England):

The mathematical context of the
recent (25th. July 1999) discovery of the
largest known composite Fermat number

Note . The Maple file of this talk, and many other Maple worksheets

  • 1st. year Maple/Calculus/Analysis
  • 2nd year Number Theory
  • 3rd year Number Theory and Cryptography
  • some public lectures

together with course notes, examination papers (written and Maple lab), may be accessed at my Web site.

Dedication .

I dedicate this talk to the French scientist Yves Gallot (Toulouse),
and the German mathematician Wilfrid Keller (Hamburg)

Structure of my talk [All the standard mathematical ideas presented in this talk are treated in my

undergraduate courses with my students in St. Patrick's College, Drumcondra. Most of my students

are taking the B.Ed. degree, with a view to becoming primary school teachers in Ireland.]

In the late afternoon of Friday 23rd. August 1999, I sent the following announcement to the Irish
Mathematics Departments List Server, and to a number of individual mathematicians worldwide:

Dear Friends and colleagues,

I am delighted to inform you that using Yves Gallot's Proth program I have just found the

10th. largest known prime
(and a new Irish prime record into the bargain). The prime is:

3* 2^382449+1 ,
and it has 115130 digits.

All the credit goes to Proth (1878, whose theorem I teach to my 3rd. years), to Gallot for his
remarkable program, and to my College for computer access during the slack Summer period.
I have put up a brief note about it on my web site (<www.spd.dcu.ie/johnbcos>).

Then, two days later , on the evening of Sunday 25th. August I sent out the following much more
exciting announcement:

ANNOUNCING THE LARGEST KNOWN COMPOSITE FERMAT NUMBER

Dear Friends and colleagues,

Using Yves Gallot's remarkable Proth program I have made the fortuitous discoveries that:

1.
p = 3 * 2^382449+1 is prime (the 10th. largest known one, and the
3rd. largest non-Mersenne prime),
2.
p is a divisor of the Fermat number F[382447] = 2^(2^382447)+1

making
F[382447] be the largest known composite Fermat number , and the sixth
[added later: its actually the 7th.] Fermat number for which a factor has been found
using Gallot's program.

3.
p is a divisor of the following 'generalized Fermat numbers' (GFN's):

F[382443,6] = 6^(2^382443)+1 ,

F[382447,3] = 3^(2^382447)+1 ,
F[382447,12] = 12^(2^382447)+1 ,

4.
p is not a divisor of any GF[5,m] = 5^(2^m)+1 nor of any GF[10,m] = 10^(2^m)+1 ,

5.
p is a 'generalized Cullen prime.'

Previously the largest known composite Fermat number was

F[3030885,m] = 2^(2^303088)+1 , with prime 3* 2^303093+1 [Jeff Young, 1998]

I made my chance discovery while making a systematic Proth-Gallot test of all numbers

3* 2^n+1 , with ' n ' ranging between 366,000 and 390,000, spread over 40-50 machines in

my College's main computer laboratory, during the past two months.

Best wishes to you all, John

REFERENCES

1. Wilfrid Keller maintains the 'Prime factors k*2^n + 1 of Fermat
numbers F[m] and complete factoring status' site at:
<http://vamri.xray.ufl.edu/proths/fermat.html>

2. Ray Ballinger valiantly maintains the Proth prime search site at:
<http://vamri.xray.ufl.edu/proths/>

3. Chris Caldwell maintains [just in case you didn't know] the
remarkable Prime number site at:
<http://www.utm.edu/research/primes>

Much more detail concerning the story and timing of the discovery may

be seen at my College we site, including a simple analysis showing that

the supra-astronomically large number


F[382447] = 2^(2^382447)+1

has

Euclid and perfect numbers (briefly!) [Much greater detail may be viewed in one of my Maple

public lectures, given in October 1997, available at my web site.]

Recall that a perfect number is one whose sum of factors - excluding itself - is equal to itself.

Examples

  • 6 is perfect, because the factors of 6 are 1, 2, 3 and 6, and 1+2+3 = 6 .
  • 28 is perfect, because the factors of 28 are 1, 2, 4, 7, 14 and 28, and 1+2+4+7+14 = 28
  • 496 is perfect, because the factors of 496 are 1, 2, 4, 8, 16, 31, 62, 124, 248 and 496, and
    1+2+4+8+16+31+62+124+248 = 496

Euclid's great discovery (and one to which students may easily be led) was : Let n be a natural number
such that (
2^n-1 ) is a prime number, then the number 2^(n-1)*(2^n-1) is a perfect number.

Examples .

  • 2^3-1 = 7 is prime, and thus the number 2^2*(2^3-1) = 4 * 7 = 28 , is perfect
  • 2^13-1 = 8191 is prime, and thus the number 2^12*(2^13-1) = 4096 * 8191 = 33,550,336,
    is perfect

> isprime(2^13 - 1);

true

> 2^12*(2^13-1);

33550336

>

Historical (historic, and unsolved) question : For which values of n is ( 2^n-1 ) prime?

Some partial answers .

  • If n is composite (i.e., is not prime) then ( 2^n-1 ) is also composite,

and - as a consequence -

  • if ( 2^n-1 ) is prime, then n is prime.

Warning . It is not true that

  • if n is prime then ( 2^n-1 ) is prime

Examples . Note that 11, 23 and 29 are all prime, but:

> isprime(2^11 - 1);

false

> ifactor(2^11 - 1);

``(23)*``(89)

>

> isprime(2^23 - 1);

false

> ifactor(2^23 - 1);

``(47)*``(178481)

>

> isprime(2^29 - 1);

false

> ifactor(2^29 - 1);

``(233)*``(1103)*``(2089)

>

Return to Structure of my talk

Mersenne primes .

Definitions.

  • Let p be prime, then M[p] = 2^p-1 , is the Mersenne number
    formed from the prime
    p .
  • Let p be prime; if M[p] = 2^p-1 is prime, then it is said to be
    a Mersenne prime.

> Mersenne := proc(n1, n2) local p;
for p from n1 to n2 do
if isprime(p) and isprime(2^p - 1)
then print(p, 2^p - 1) fi od end:

>

> Mersenne(2, 100);

>

WARNING . Do not fall into the trap of thinking that you can find big Mersenne primes using

this ... !! I am attempting to avoid straying into very, very deep waters.

Return to Structure of my talk

Fermat numbers . Whereas Mersenne primes (primes that are a power of 2, minus 1) had

their origin is a question asked in the 3rd. century B.C. (and earlier), Fermat primes/numbers

had their origin in 1640.

Pierre de Fermat (1601-1665 , and the ' father of modern Number Theory ') - a contemporary

and correspondent of Mersenne's - asked himself this apparently simple question , sometime

in the Summer of 1640:

  • Which primes are a power of 2, plus 1? That is, for which values of r ( r = 1, 2, 3, 4, 5, 6, 7 ...)
    is (
    2^r+1 ) a prime?

School children, students, anyone, may easily check by hand that:

  • When r = 1 , 2^r+1 = 2+1 = 3, is prime
  • When r = 2 , 2^r+1 = 4+1 = 5, is prime
  • When r = 3 , 2^r+1 = 8+1 = 9 = 3*3, is not prime
  • When r = 4 , 2^r+1 = 16+1 = 17, is prime
  • When r = 5 , 2^r+1 = 32+1 = 33 = 3*11, is not prime
  • When r = 6 , 2^r+1 = 64+1 = 65 = 5*13, is not prime
  • When r = 7 , 2^r+1 = 128+1 = 129 = 3*43, is not prime
  • When r = 8 , 2^r+1 = 256+1 = 257, is prime

At this point (and this has always been my experience, over many years, with my own students)

any numerically sensitive person will immediately leap to the guesses / questions :

  • Is ( 2^r+1 ) composite when r is not a power of 2? [Here the answer is a simple ' yes ,' and it is
    an elementary exercise to prove it.]
  • Is ( 2^r+1 ) prime when r is a power of 2? That is, letting F[m] = 2^(2^m)+1 ( m = 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 , ... )
    be the
    m -th Fermat number, is it true that F[m] is prime for all m ?

In a letter to Frenicle of August 1640 (and another of October 1640; both letters available - in French -

at Antreas P. Hatzipolakis's we site: <http://users.hol.gr/~xpolakis/fermat/fac.html>) Fermat wrote as

follows (English translation quoted from M.S.Mahoney's The Mathematical Career of Pierre de Fermat ,

Princeton University Press, 2nd edition, 1994; see also Andre Weil's Number Theory ( An approach through

history ), Birkhauser, 1984):

But here is what I admire most of all: it is that I am just about convinced that all progressive numbers

augmented by unity, of which the exponents are numbers of the double progression, are prime numbers,

such as

3, 5, 17, 257, 65537, 4294967297

and the following of twenty digits

18446744073709551617, etc.

I do not have an exact proof of it, but I have excluded such a large quantity of divisors by infallible

demonstrations, and my thoughts rest on such clear insights, that I can hardly be mistaken.

Fermat returned to this question over and over again in the remaining 25 years of his life, and when he

died in January 1665 he could not - perhaps - have imagined that all would change quite dramatically in

the following century... .

Return to Structure of my talk

Fermat-Euler theorem (1732) .

Briefly this theorem (which lies unproved in the work of Fermat - and has its origins in Fermat's studies

of which primes may be the hypothenuse of an integer sided right angled triangle...) states this:

Let m be any natural number, and x be any integer, then every odd prime divisor p of the integer

( x^(2^m)+1 ) leaves remainder 1 when divided by 2^(m+1) .

In other words, every odd prime divisor p of the integer ( x^(2^m)+1 ) must have the following structure :

p = k * 2^(m+1)+1 ,

for some k = 1, 2, 3, 4, 5, 6 , ...

Examples :

> m := 4; # and so (m+1) is 5

m := 4

> 2^m;

16

> 2^(m+1);

32

> x := 5;

x := 5

> x^(2^m) + 1;

152587890626

> ifactor(x^(2^m) + 1);

``(2)*``(29423041)*``(2593)

> 2593 mod 2^(m+1);

1

> 29423041 mod 2^(m+1);

1

>

What Euler did (actually Andre Weil is of the view (which I am in sympathy) that Fermat himself

also did this - using his unproven discovery - but made an arithmetical error) was to attempt to find
a factor of:

F[5] = 2^(2^5)+1 = 2^32+1 = 4294967297

by using the proved result that any prime factor p of F[5] must be of the form:

p = 64*k+1 (some k = 1, 2, 3, 4 , ... )

and, when he got up to k = 10 he found that p = 64 * 10+1 = 641
is a proper factor of
F[5] :

> F := m -> 2^(2^m) + 1; # defining the FUNCTION 'F'

F := proc (m) options operator, arrow; 2^(2^m)+1 en...

> F(5);

4294967297

> F(5)/641;

6700417

> ifactor(F(5));

``(641)*``(6700417)

>

and in the following century, Landry (in 1880, and at the age of 82!) found a proper factor of:

F[6] = 2^(2^6)+1 = 2^64+1

> F(6);

18446744073709551617

> ifactor(F(6));

``(67280421310721)*``(274177)

>

Warning . I am not going to use Maple to attempt to factor
F[7] = 2^(2^7)+1 :

> F(7);

340282366920938463463374607431768211457

>

because that number was only factored as recently as 1970 -
it has the following prime factorization:

F[7] = ( 116503103764643 * 2^9+1 )*( 11141971095088142685 * 2^9+1 )


and it was only possible to do so because of a very great theoretical advance, made that year,

due to Brillhart and Morrison .

> p1 := 116503103764643*2^9 + 1;

p1 := 59649589127497217

> isprime(p1);

true

> p2 := 11141971095088142685*2^9 + 1;

p2 := 5704689200685129054721

> isprime(p2);

true

> N := p1*p2;

N := 340282366920938463463374607431768211457

> is(F(7) = N);

true

>

However, in 1970 it had already been known from the first decade of this century that F[7] is composite!!

Return to Structure of my talk

Question . (leading to Pepin's theorem )

  • How was it possible to know at an earlier time (than 1970) that F[7] is composite?

This brings us to Pepin's remarkable theorem of 1877 :

F[m] = 2^(2^m)+1 is a prime if and only if the number


3^((F[m]-1)/2)

leaves remainder -1 when divided by F[m] .

That is, F[m] is a prime if and only if

3^((F[m]-1)/2) = F[m]*q-1 ... (P)

for some integer q .

Small hand performed example , by way of illustration :

Let m = 2 , then F[m] = F[2] = 2^(2^2)+1 = 17, and so

3^((F[m]-1)/2) = 3^((17-1)/2) = 3^8 = 6561 ,

and dividing 6561 by 17 we get:

6561 = 17 * 386-1 ... [compare with P, above]

proving, by Pepin's theorem that F[2] = 2^(2^2)+1 = 17, is prime.

That small example was for illustration purposes only ; no one would seriously prove that 17 is prime

by appealing to Pepin's theorem!! However for larger values of m , it really is a serious issue to decide

the status of F[m] by using Pepin's theorem (though researchers are currently stuck on the case m = 24 ).

Here is the Maple command for that latter computation:

> mods(3^((F(2) - 1)/2), F(2));

-1

> mods(3^((F(3) - 1)/2), F(3));

-1

> mods(3^((F(4) - 1)/2), F(4));

-1

>

Incidentally, let us just have a peek at the value of the number [which I OMIT in

the primted form to save space. remove the comment sign '#' before the command if

you wish to execute it]:

> # 3^((F(4) - 1)/2);

>

It is quite large! This computes how many digits it has:

> length(3^((F(4) - 1)/2));

15635

>

Now let's do the Euler case, where m = 5 :

> F(5);

4294967297

>

But see what happens when we attempt to apply the Pepin theorem:

> mods(3^((F(5) - 1)/2), F(5));

Error, integer too large in context

>

So, is Maple useless, when we only get up to the modest sized m = 5 ?

No!! Not at all. You see, what has happened above is that that Maple
was being asked to:

  • First compute the actual value of the number 3^((F(5)-1)/2) ,
  • and only then calculate its remainder on division by F(5)

However, by using a combination of two ideas from Number Theory - the method of congruences ,

and modular exponentiation (I teach such methods to my students, with applications to modern

Public-Key Cryptography - one can circumvent the difficulty caused by the above first step.

When those ideas are taken into account, there is a corresponding Maple command that now allows

one to return to the above computation, and in the process determine the nature of the 5th. Fermat number.

First, let us redo the earlier F[4] case:

> mods(3&^((F(4) - 1)/2), F(4));

-1

>

and now let us re-view the F[5] case:

> mods(3&^((F(5) - 1)/2), F(5));

10324303

>

The fact that the '10324303' is not ' -1 ' proves - using Pepin's theorem - that F[5] is not prime.

> mods(3&^((F(6) - 1)/2), F(6));

-6586524273069171148

> mods(3&^((F(7) - 1)/2), F(7));

110780954395540516579111562860048860420

> mods(3&^((F(8) - 1)/2), F(8));

586454539974218386257801801618341002546549190472251...

> mods(3&^((F(9) - 1)/2), F(9));

348784219229283416082867780492645287330765693502675...
348784219229283416082867780492645287330765693502675...

> mods(3&^((F(10) - 1)/2), F(10));

387619810475491122179739047140959275426443598784645...
387619810475491122179739047140959275426443598784645...
387619810475491122179739047140959275426443598784645...
387619810475491122179739047140959275426443598784645...

>

>

Those computations establish that F[5], F[6], F[7], F[8], F[9], F[10] are all composite - a very

far cry from Fermat's belief that all F[m] 's are prime!!

Return to Structure of my talk

The current state of knowledge re Fermat numbers . I mention
only some of the most important
:

  • The only known Fermat primes are the first five: F[0], F[1], F[2], F[3], F[4]
    [the
    current orthodoxy is that these are the only Fermat primes.
    I do not share that view, and would maintain that some work of
    mine, from March of 1999, casts considerable doubt on this...]
  • F[m] is known to be composite for all m with 4 < m <= 23
  • F[14], F[20], F[22] have no known factors
  • The status of F[24] is completely unknown (at least two research teams - led by very, very
    big names in Computational Number Theory, Richard Crandall (Director of the Centre for
    Advanced Scientific Computation, Oregon) and Richard Brent (Director of the National
    Computing Laboratory, Australia, and presently in Oxford, England) - are working on this problem)

Francois Proth (1852-1879), a self-taught French farmer, discovered and proved the following
theorem in 1878 (I teach it to my 3rd. year students, and notes about it are available form my web site):

Let N = k * 2^n+1 where k and n are narural numbers with k < 2^n ; then N is a prime number if
and only if there is an integer
a with the property that:

a^((N-1)/2) leaves remainder -1 on division by N ,

in other words, if and only if

a^((N-1)/2) = N.q-1 ... (P')

for some integer q .

Small hand performed example (with k = 3 and n = 2 ):

Let N = 13 = 3* 2^2+1 , then choosing a = 2 we find that

a^((N-1)/2) = 2^((13-1)/2) = 2^6 = 64 , and we have:

64 = 13 * 5-1 ... (compare with P' above)

and so, by Pepin's theorem, N = 13 is prime.

Return to Structure of my talk

Yves Gallot (Toulouse, France, where Fermat discovered the numbers that now bear his name)

has written a truly extraordinary program - named Proth.exe after Proth, whom Gallot holds in high

esteem (as I do too) - which incorporated Proth's theorem with a great new idea of the the past

twenty years - the Fast Fourier Transform (FFT).

Basically what his program does is this: it searches for primes p of the form:

p = k.(2^n)+1

and - whenever it finds such a prime p - it then tests to see if p divides

what one might call the associated Fermat number.

In particular, on finding the recent prime p = 3 * 2^382449+1 , his program then proceeded to perform

the monumental computation that p is a factor of F[382447] = 2^(2^382447)+1 .

I have prepared a simple Maple worksheet - available from my web site - showing that the number of

digits that F[382447] has approximately 10^(115, 136) digits, and would require a square board with side

length approximately 10^(57, 550) LIGHT YEARS in order to write F[382447] in decimal notation at 4

digits per inch, and even if one were to write the digits at 10^30 digits per inch it would only bring the

side of the square down to (not a surprise) 10^(57, 520) light years.

Web site references :

  • Yves Gallot's remarkable Proth.exe program may be downloaded from:

    <http://perso.wanadoo.fr/yves.gallot/primes/gfn.html>
  • Dr. Ray Ballinger of the University of Florida valiantly maintains the Proth prime search site at:

    <http://vamri.xray.ufl.edu/proths/>
  • The current complete factoring status re Fermat numbers is maintained by Dr. Wilfrid Keller
    (who once - in 1984 - held the record for the largest known composite Fermat number; it was
    then
    F[23471] ) of Hamburg University at this site:

    <http://vamri.xray.ufl.edu/proths/fermat.html>
  • For matters relating to primes in general one should look no further than Dr. Chris Caldwell's
    monumental site at:

    <http://www.utm.edu/research/primes/>

Return to Structure of my talk

Here, finally, is the above 115,130 digit prime p [I have suppressed it in the PRINTED form to save space]:

> #p := 3*2^382449 + 1;

> length(p);

115130

>

Return to Structure of my talk

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:09:07 -0000