proof of Lucas-Lehmer primality test

proof of Lucas-Lehmer primality test

The objective of this article is to prove the

Lucas-Lehmer primality test

:

Let

p

>

2

be a prime, and let

M

p

=

2

p

-

1

be the corresponding

Mersenne number

. Then

M

p

is prime if and only if

M

p

divides

s

p

-

1

(equivalently, if and only if

s

p

-

1

≡

0

(

M

p

)

) where the numbers

(

s

n

)

n

≥

1

are given by the following

recurrence relation

:

s

1

=

4

s

n

+

1

=

s

n

2

-

2

,

n

≥

1

We show that the

validity

of the

primality test

is

equivalent

to the following

theorem

, which is then proved directly:

Theorem 1

.

(Lucas)

M

p

is prime if and only if

α

(

M

p

+

1

)

/

2

≡

-

1

(

M

p

)

, where

α

=

2

+

3

.

To see that the two are in fact equivalent, let

β

=

2

-

3

. Then

α

+

β

=

4

,

α

⁢

β

=

1

. Thus

s

1

=

α

+

β

s

2

=

(

α

+

β

)

2

-

2

=

α

2

+

β

2

+

2

⁢

α

⁢

β

-

2

=

α

2

+

β

2

s

3

=

α

4

+

β

4

⋯

s

p

-

1

=

α

2

p

-

2

+

β

2

p

-

2

Note that

2

p

-

2

=

M

p

+

1

4

. Then

s

p

-

1

≡

0

(

M

p

)

⇔

α

(

M

p

+

1

)

/

4

+

β

(

M

p

+

1

)

/

4

≡

0

(

M

p

)

⇔

α

(

M

p

+

1

)

/

2

+

(

α

⁢

β

)

(

M

p

+

1

)

/

4

≡

0

(

M

p

)

⇔

α

(

M

p

+

1

)

/

2

≡

-

1

(

M

p

)

It thus remains to prove Theorem

1

. We start with two simple lemmas:

Lemma 2

.

If

p

>

3

is prime, then

α

p

-

1

≡

1

(

p

)

or

α

p

+

1

≡

1

(

p

)

.

Proof.

α

p

≡

2

p

+

3

(

p

-

1

)

/

2

⁢

3

≡

{

α

(

p

)

if

⁢

(

3

p

)

=

1

β

(

p

)

if

⁢

(

3

p

)

=

-

1

where

(

⋅

⋅

)

is the

Legendre symbol

. Thus

(

3

p

)

=

1

⇒

α

p

-

1

=

α

p

⁢

α

-

1

=

α

p

⁢

β

≡

α

⁢

β

=

1

(

p

)

(

3

p

)

=

-

1

⇒

α

p

+

1

=

α

p

⁢

α

≡

β

⁢

α

=

1

(

p

)

∎

Lemma 3

.

Let

p

be a prime with

p

≡

7

(

8

)

and

p

≡

7

(

12

)

. Then

α

(

p

+

1

)

/

2

≡

-

1

(

p

)

.

Proof.

(

1

+

3

)

2

=

4

+

2

⁢

3

=

2

⁢

α

, so that

(

1

+

3

)

p

+

1

=

2

(

p

+

1

)

/

2

⁢

α

(

p

+

1

)

/

2

But

p

≡

7

(

8

)

, so that

(

2

p

)

=

1

. Thus

2

(

p

+

1

)

/

2

≡

2

⋅

2

(

p

-

1

)

/

2

≡

2

(

p

)

and therefore

(

1

+

3

)

p

+

1

≡

2

⁢

α

(

p

+

1

)

/

2

(

p

)

Also,

(

1

+

3

)

p

+

1

=

(

1

+

3

)

⁢

(

1

+

3

)

p

≡

(

1

+

3

)

⁢

(

1

+

3

(

p

-

1

)

/

2

⁢

3

)

(

p

)

But

p

≡

7

(

12

)

, so

3

(

p

-

1

)

/

2

≡

-

1

(

p

)

and thus

(

1

+

3

)

p

+

1

≡

(

1

+

3

)

⁢

(

1

-

3

)

=

-

2

(

p

)

Putting together the two expressions for

(

1

+

3

)

p

+

1

, we get

α

(

p

+

1

)

/

2

≡

-

1

(

p

)

.
∎

We are now in a position to prove Theorem

1

:

Proof.

(

⇒

)

:

If

M

p

is prime where

p

>

3

is prime, then note that

M

p

≡

7

(

8

)

,

7

(

1

)

2

so that

M

p

satisfies

the conditions of Lemma

3

. The result follows.

(

⇐

)

:

If

α

(

M

p

+

1

)

/

2

≡

-

1

(

M

p

)

, choose

q

∣

M

p

for

q

a prime. Since

M

p

≡

7

(

1

)

2

, we have

q

>

3

. Since

α

(

M

p

+

1

)

/

2

≡

-

1

(

M

p

)

also

α

(

M

p

+

1

)

/

2

≡

-

1

(

q

)

and thus

α

M

p

+

1

≡

1

(

q

)

. But

M

p

+

1

=

2

p

, so

α

2

p

≡

1

(

q

)

Thus the order of

α

(

q

)

divides

2

n

. It can’t divide

2

n

-

1

since

α

(

M

p

+

1

)

/

2

≡

-

1

(

q

)

, so its order is precisely

2

n

=

M

p

+

1

. However,

α

q

+

1

≡

1

(

q

)

or

α

q

-

1

≡

1

(

q

)

by Lemma

2

and thus

q

≥

M

p

. But

q

∣

M

p

, so

q

=

M

p

and

M

p

is in fact prime.
∎

Title

proof of Lucas-Lehmer primality test

Canonical name

ProofOfLucasLehmerPrimalityTest

Date of creation

2013-03-22 18:42:16

Last modified on

2013-03-22 18:42:16

Owner

rm50 (10146)

Last modified by

rm50 (10146)

Numerical id

5

Author

rm50 (10146)

Entry type

Proof

Classification

msc 11A51

Generated on Fri Feb 9 15:20:35 2018 by

LaTeXML