< Back to johnbcosgrave.com


 

> # pockling(ton).mws

Using Pocklington's (1914) theorem to test
primality of some specially constructed numbers

[ An initial carrot . Below I present - with proof - the (quite fortuitous) discovery of a 2000-digit prime . I would like to call it a millennium prime .]

Introduction . In a separate Maple worksheet (1914_pap.mws) I have worked through H.C.Pocklington's paper The Determination of the
Prime or Composite Nature of Large Numbers by Fermat's theorem
, which was published in the Proceedings of the Cambridge Philosophical

Society in 1916 (it was only two pages long!), and "Read" by Pocklington on the 9th. of March 1914. In modern expositions of Pocklington's paper

there is some lack of consistency as to what is ' Pocklington's Theorem ' - possibly because at no point in his paper does Pocklington himself

actually state a theorem! - one has to weed it (actually them) out from his (beautiful) analysis of some consequences of Fermat's 'little' theorem.

What I did in 1914_pap.mws was to go back to Pocklington's original paper, work through his presentation (changing some notation here and there -

I don't like his using ' [Maple Math] ' as a symbol for a prime - and also try to make it more understandable), and weave in some illustrative Maple computations

(Pocklington's paper does not contain a single numerical illustration!).

My aim in this worksheet was to present some illustrations of his theorem - or rather one version of one of his theorems - to some specially constructed numbers, to present to my third year B.Ed. and B.A. students in this year's Number Theory and Cryptography course.

Anyone well versed in number theoretical arts will immediately recognise that the numbers I have chosen as possible candidates for being prime stood little chance of success ; rather they were chosen (from a huge range of other equally interesting possible ones) because of the beauty of their structure.

I have (like any number theorist) a deep personal attachment to the Euclidean numbers - the numbers of the form [Maple Math] ... [Maple Math] - where

[Maple Math] , ... , [Maple Math] are the first n prime numbers, and what I have done here was to choose [Maple Math] , and form its n -th power [Maple Math] . That latter number - which is obviously greater than [Maple Math] ... [Maple Math] - is the ' [Maple Math] ' in the following theorem, as is the number [Maple Math] ... [Maple Math] the 'U ' of it.

A Pocklington theorem : Let N be a natural number and let [Maple Math] , where p is prime, [Maple Math] is the largest power of p dividing ( [Maple Math] ), and [Maple Math] . Suppose also that

[Maple Math] (mod N ) for some integer a ... ( i )

and

[Maple Math] ... ( ii )

then N is prime . [ end ]

So, I now wish to apply that theorem to the sequence of numbers { [Maple Math] }, where:

[Maple Math] = 2*3 + 1,

[Maple Math] = 2*3* [Maple Math] + 1,

[Maple Math] = 2*3* [Maple Math] * [Maple Math] + 1,

.

.

[Maple Math] = [Maple Math] ... [Maple Math]

Nomenclature . [" What's in a name? ... "] I would like to call the above numbers ' L shaped Euclidean numbers ', the name being suggested by the following picture:

7
*

7

*

7

[Maple Math] = 2*3*5* + 1

The L shaped Euclidean numbers can be computed by defining the function ' f ' as follows :

> f := n -> product(ithprime(k), k=1..n)*ithprime(n+1)^n + 1;

[Maple Math]

> f(1); # 2*3 + 1:

[Maple Math]

> f(2); # 2*3*5^2 + 1:

[Maple Math]

> f(3); # 2*3*5*7^3 + 1:

[Maple Math]

These - and others - are the numbers that I wish to subject to the above Pocklington theorem to test for primality.

Before launching into a systematic search, I will illustrate two individual examples - [Maple Math] and [Maple Math] - with ' a ' chosen to be 2:

> f(9);

[Maple Math]

> 2&^(f(9) - 1) mod f(9);

[Maple Math]

Thus [Maple Math] has failed condition ( i ) of Pocklington - which, being Fermat's test to the base 2 - means immediately that [Maple Math] is composite.

Now to test [Maple Math] :

> f(10);

[Maple Math]

> 2&^(f(10) - 1) mod f(10);

[Maple Math]

> igcd(2&^((f(10)-1)/ithprime(11)) mod f(10) - 1, f(10));

[Maple Math]

Thus [Maple Math] is proved to be prime by Pocklington's theorem.

Now to engage in a systematic search, in which I fix ' a ' at 2 .

I first seek numbers which satisfy condition ( i ) of Pocklington's theorem; that is, I simply look for values of ' k ' for which [Maple Math] passes
Fermat's test to the base 2.

Subsequently I will further subject the corresponding f 's to condition ( ii ) of Pocklington's theorem. [Of course I realise that I could
have incorporated the two conditions into a single procedure.]

> candidates := proc(m, n)
local k;
for k from m to n do
if 2&^(f(k)-1) mod f(k) = 1
then print(k)
fi
od
end:

> candidates(1, 30);

[Maple Math]

[Maple Math]

[Maple Math]

[Maple Math]

So, we have four candidates out of the first thirty L shaped Euclidean numbers.

The first two produce primes ( [Maple Math] = 2*3 + 1 = 7, and [Maple Math] = 2*3* [Maple Math] + 1 = 151, are prime). I have already shown [Maple Math] is prime above, and so only [Maple Math] remains:

> igcd(2&^((f(20)-1)/ithprime(21)) mod f(20) - 1, f(20));

[Maple Math]

So [Maple Math] is also prime, and here it is:

> f(20);

[Maple Math]

> length(f(20));

[Maple Math]

I now proceed to search for others:

> candidates(31, 60); # no output

> candidates(61, 120); # no output

> candidates(121, 180);

[Maple Math]

> igcd(2&^((f(173)-1)/ithprime(174)) mod f(173) - 1, f(173));

[Maple Math]

> length(f(173));

[Maple Math]

Great!!! It follows that [Maple Math] is prime, and it has 952 digits!!

I want a ' titanic ' prime (one with at least 1000 digits) though!!

On we go:

> candidates(181, 240); # no output

> candidates(241, 300); # no output

> length(f(300));

[Maple Math]

> candidates(301, 330);

[Maple Math]

At long last - another L shaped candidate!!

Let's subject it to condition ( ii ) of Pocklingtho's theorem:

> igcd(2&^((f(325)-1)/ithprime(326)) mod f(325) - 1, f(325));

[Maple Math]

Great!!! [Maple Math] is prime!!! And how many digits does it have?:

> length(f(325));

[Maple Math]

Wow!!! I'd like to call it a millenium prime .

And here it is:

> f(325);

[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]
[Maple Math]
[Maple Math]
[Maple Math]

This is how [Maple Math] is constructed .

First , form the first 325 primes:

> seq(ithprime(k), k=1..325);

[Maple Math]
[Maple Math]
[Maple Math]
[Maple Math]
[Maple Math]
[Maple Math]
[Maple Math]
[Maple Math]
[Maple Math]
[Maple Math]
[Maple Math]
[Maple Math]

Next , form their product:

> U := product(ithprime(k), k=1..325);

[Maple Math]
[Maple Math]
[Maple Math]
[Maple Math]
[Maple Math]
[Maple Math]
[Maple Math]
[Maple Math]

Now , let ' p ' be the 326-th. prime number:

> p := ithprime(326);

[Maple Math]

Form the 325-th. power of that prime p :

> p^325;

[Maple Math]
[Maple Math]
[Maple Math]
[Maple Math]
[Maple Math]
[Maple Math]
[Maple Math]
[Maple Math]
[Maple Math]
[Maple Math]

Finally , form the number N , defined by [Maple Math] .

That N is the number 2000-digit prime [Maple Math] , which I would like to

call ' millennium prime '. Here it is:

> millennium_prime := p^325*U + 1;

[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]
[Maple Math]
[Maple Math]
[Maple Math]

> length(millennium_prime);

[Maple Math]

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:18 -0000