people.math.sc.edu...mersenne primes the lucas-lehmer test. let p be an odd prime, and define...

15
Mersenne Primes Definition. A Mersenne prime is a prime of the form 2 n - 1. Equivalently, ... of the form 2 p - 1 where p is a prime. Mersenne primes are related to perfect numbers. Euler showed that σ (m)=2m, where m is even if and only if m =2 p-1 (2 p - 1) where p and 2 p - 1 are primes. The largest known prime is 2 1. 2 77232917 - 1

Upload: others

Post on 06-Sep-2020

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: people.math.sc.edu...Mersenne Primes The Lucas-Lehmer Test. Let p be an odd prime, and define recursively L 0 =4 and L n+1 = L 2 n 2 (mod (2 p 1)) for n 0. Then 2p 1 is a prime if

Mersenne Primes

The Lucas-Lehmer Test. Let p be an odd prime, and definerecursively

L0 = 4 and Ln+1 = L2n � 2 (mod (2p � 1)) for n � 0.

Then 2p � 1 is a prime if and only if Lp�2 = 0.

Definition. A Mersenne prime is a prime of the form 2n � 1.

• Equivalently, . . . of the form 2p � 1 where p is a prime.

• Mersenne primes are related to perfect numbers. Eulershowed that �(m) = 2m, where m is even if and only ifm = 2p�1(2p � 1) and 2p � 1 is prime.

• The largest known prime is 257885161 � 1.

Definition. A Mersenne prime is a prime of the form 2n � 1.

• Equivalently, . . . of the form 2p � 1 where p is a prime.

• Mersenne primes are related to perfect numbers. Eulershowed that �(m) = 2m, where m is even if and only ifm = 2p�1(2p � 1) and 2p � 1 is prime.

• The largest known prime is 257885161 � 1.

Definition. A Mersenne prime is a prime of the form 2n � 1.

• Equivalently, . . . of the form 2p � 1 where p is a prime.

• Mersenne primes are related to perfect numbers. Eulershowed that �(m) = 2m, where m is even if and only ifm = 2p�1(2p � 1) where p and 2p � 1 are primes.

• The largest known prime is 257885161 � 1.

Definition. A Mersenne prime is a prime of the form 2n � 1.

• Equivalently, . . . of the form 2p � 1 where p is a prime.

• Mersenne primes are related to perfect numbers. Eulershowed that �(m) = 2m, where m is even if and only ifm = 2p�1(2p � 1) where p and 2p � 1 are primes.

• The largest known prime is 257885161 � 1.277232917 � 1

Page 2: people.math.sc.edu...Mersenne Primes The Lucas-Lehmer Test. Let p be an odd prime, and define recursively L 0 =4 and L n+1 = L 2 n 2 (mod (2 p 1)) for n 0. Then 2p 1 is a prime if

Suppose n ⌘ 7 (mod 4) isprime. We can take P = 4.

v1 = 4, v2 = 14, . . . v2n+1 = v22n � 2 (n � 0)

Compute un modulo p by using✓

un+1 vn+1

un vn

◆= Mn

✓1 P0 2

◆where M =

✓P �Q1 0

◆.

un =↵n � �n

↵ � �and vn = ↵n + �n for n � 0,

where ↵ = (P +p

D)/2 and � = (P �p

D)/2

2n�1un =

✓n

1

◆P n�1 +

✓n

3

◆P n�3D +

✓n

5

◆P n�5D2 + · · ·

=) p|up+1

Compute un modulo p by using✓

un+1 vn+1

un vn

◆= Mn

✓1 P0 2

◆where M =

✓P �Q1 0

◆.

un =↵n � �n

↵ � �and vn = ↵n + �n for n � 0,

where ↵ = (P +p

D)/2 and � = (P �p

D)/2

2n�1un =

✓n

1

◆P n�1 +

✓n

3

◆P n�3D +

✓n

5

◆P n�5D2 + · · ·

=) p|up+1

The Lucas Primality Test

Fix integers P and Q. Let D = P 2 � 4Q. Define recursivelyun and vn by

u0 = 0, u1 = 1, un+1 = Pun � Qun�1 for n � 1,

v0 = 2, v1 = P, and vn+1 = Pvn � Qvn�1 for n � 1.

If p is an odd prime and p - PQ and D(p�1)/2 ⌘ �1 (mod p),then p|up+1.

Idea: Given a large positive integer n, if n is prime, there isa 50-50 chance that a D will satisfy D(p�1)/2 ⌘ �1 (mod n).Play with P and Q until you find such a D with n - PQ.Compute un+1 quickly and check if n|un+1. If not, then n iscomposite. If so, then it is likely n is prime.

How do we compute un+1 quickly?

Why does p|up+1 if p is an odd prime?

Why should we think n is likely a prime if n|un+1?

Definition. A Mersenne prime is a prime of the form 2n � 1.

• Equivalently, . . . of the form 2p � 1 where p is a prime.

• Mersenne primes are related to perfect numbers. Eulershowed that �(m) = 2m, where m is even if and only ifm = 2p�1(2p � 1) where p and 2p � 1 are primes.

• The largest known prime is 257885161 � 1.

un =(2 +

p3)n � (2 �

p3)n

p12

and vn = (2+p

3)n+(2�p

3)n

O�ce Hours and Such:

I will not have regular o�ce hours tomorrow. I “should” bearound tomorrow afternoon (2:00-4:00), but do let me knowif you plan to come by.

Mersenne Primes

The Lucas Primality Test

The Lucas-Lehmer Test. Let p be an odd prime, and definerecursively

L0 = 4 and Ln+1 = L2n � 2 mod (2p � 1) for n � 0.

Then 2p � 1 is a prime if and only if Lp�2 = 0.

Suppose n ⌘ 7 (mod 4) isprime. We can take P = 4.

v1 = 4, v2 = 14, . . . v2n+1 = v22n � 2 (n � 0)

Ln = v2n

N = 2p � 1 is a prime () v(N+1)/4 is divisible by N

Suppose n ⌘ 7 (mod 4) isprime. We can take P = 4.

v1 = 4, v2 = 14, . . . v2n+1 = v22n � 2 (n � 0)

Ln = v2n

m = 2p � 1 is a prime () v(m+1)/4 is divisible by m

Page 3: people.math.sc.edu...Mersenne Primes The Lucas-Lehmer Test. Let p be an odd prime, and define recursively L 0 =4 and L n+1 = L 2 n 2 (mod (2 p 1)) for n 0. Then 2p 1 is a prime if

Suppose n ⌘ 7 (mod 4) isprime. We can take P = 4.

v1 = 4, v2 = 14, . . . v2n+1 = v22n � 2 (n � 0)

( (= ):

( =) ):

( (= ):

( =) ):

• 3(N�1)/2 ⌘ �1 (mod N) and 2(N�1)/2 ⌘ 1 (mod N)

• It su�ces to prove v(N+1)/2 ⌘ �2 (mod N).

• 2 ±p

3 = ((p

2 ±p

6)/2)2

v(N+1)/2 =

p2 +

p6

2

!N+1

+

p2 �

p6

2

!N+1

= 2�N(N+1)/2X

j=0

✓N + 1

2j

◆p2

N+1�2jp6

2j

= 2(1�N)/2(N+1)/2X

j=0

✓N + 1

2j

◆3j

• 2(N�1)/2v(N+1)/2 ⌘ 1 + 3(N+1)/2 ⌘ �2 (mod N)

( (= ):

( =) ):

• 3(N�1)/2 ⌘ �1 (mod N) and 2(N�1)/2 ⌘ 1 (mod N)

• It su�ces to prove v(N+1)/2 ⌘ �2 (mod N).

• 2 ±p

3 = ((p

2 ±p

6)/2)2

v(N+1)/2 =

p2 +

p6

2

!N+1

+

p2 �

p6

2

!N+1

= 2�N(N+1)/2X

j=0

✓N + 1

2j

◆p2

N+1�2jp6

2j

= 2(1�N)/2(N+1)/2X

j=0

✓N + 1

2j

◆3j

• 2(N�1)/2v(N+1)/2 ⌘ 1 + 3(N+1)/2 ⌘ �2 (mod N)

( (= ):

( =) ):

• 3(N�1)/2 ⌘ �1 (mod N) and 2(N�1)/2 ⌘ 1 (mod N)

• It su�ces to prove v(N+1)/2 ⌘ �2 (mod N).

• 2 ±p

3 = ((p

2 ±p

6)/2)2

v(N+1)/2 =

p2 +

p6

2

!N+1

+

p2 �

p6

2

!N+1

= 2�N(N+1)/2X

j=0

✓N + 1

2j

◆p2

N+1�2jp6

2j

= 2(1�N)/2(N+1)/2X

j=0

✓N + 1

2j

◆3j

• 2(N�1)/2v(N+1)/2 ⌘ 1 + 3(N+1)/2 ⌘ �2 (mod N)

( (= ):

( =) ):

• 3(N�1)/2 ⌘ �1 (mod N) and 2(N�1)/2 ⌘ 1 (mod N)

• It su�ces to prove v(N+1)/2 ⌘ �2 (mod N).

• 2 ±p

3 = ((p

2 ±p

6)/2)2

v(N+1)/2 =

p2 +

p6

2

!N+1

+

p2 �

p6

2

!N+1

= 2�N(N+1)/2X

j=0

✓N + 1

2j

◆p2

N+1�2jp6

2j

= 2(1�N)/2(N+1)/2X

j=0

✓N + 1

2j

◆3j

• 2(N�1)/2v(N+1)/2 ⌘ 1 + 3(N+1)/2 ⌘ �2 (mod N)

( (= ):

( =) ):

• 3(N�1)/2 ⌘ �1 (mod N) and 2(N�1)/2 ⌘ 1 (mod N)

• It su�ces to prove v(N+1)/2 ⌘ �2 (mod N).

• 2 ±p

3 = ((p

2 ±p

6)/2)2

v(N+1)/2 =

p2 +

p6

2

!N+1

+

p2 �

p6

2

!N+1

= 2�N(N+1)/2X

j=0

✓N + 1

2j

◆p2

N+1�2jp6

2j

= 2(1�N)/2(N+1)/2X

j=0

✓N + 1

2j

◆3j

• 2(N�1)/2v(N+1)/2 ⌘ 1 + 3(N+1)/2 ⌘ �2 (mod N)

( (= ):

( =) ):

• 3(N�1)/2 ⌘ �1 (mod N) and 2(N�1)/2 ⌘ 1 (mod N)

• It su�ces to prove v(N+1)/2 ⌘ �2 (mod N).

• 2 ±p

3 = ((p

2 ±p

6)/2)2

v(N+1)/2 =

p2 +

p6

2

!N+1

+

p2 �

p6

2

!N+1

= 2�N(N+1)/2X

j=0

✓N + 1

2j

◆p2

N+1�2jp6

2j

= 2(1�N)/2(N+1)/2X

j=0

✓N + 1

2j

◆3j

• 2(N�1)/2v(N+1)/2 ⌘ 1 + 3(N+1)/2 ⌘ �2 (mod N)

( (= ):

( =) ):

• 3(N�1)/2 ⌘ �1 (mod N) and 2(N�1)/2 ⌘ 1 (mod N)

• It su�ces to prove v(N+1)/2 ⌘ �2 (mod N).

• 2 ±p

3 = ((p

2 ±p

6)/2)2

v(N+1)/2 =

p2 +

p6

2

!N+1

+

p2 �

p6

2

!N+1

= 2�N(N+1)/2X

j=0

✓N + 1

2j

◆p2

N+1�2jp6

2j

= 2(1�N)/2(N+1)/2X

j=0

✓N + 1

2j

◆3j

• 2(N�1)/2v(N+1)/2 ⌘ 1 + 3(N+1)/2 ⌘ �2 (mod N)

Suppose n ⌘ 7 (mod 4) isprime. We can take P = 4.

v1 = 4, v2 = 14, . . . v2n+1 = v22n � 2 (n � 0)

Ln = v2n

N = 2p � 1 is a prime () v(N+1)/4 is divisible by N

Page 4: people.math.sc.edu...Mersenne Primes The Lucas-Lehmer Test. Let p be an odd prime, and define recursively L 0 =4 and L n+1 = L 2 n 2 (mod (2 p 1)) for n 0. Then 2p 1 is a prime if

Suppose n ⌘ 7 (mod 4) isprime. We can take P = 4.

v1 = 4, v2 = 14, . . . v2n+1 = v22n � 2 (n � 0)

( (= ):

( =) ):

• 3(N�1)/2 ⌘ �1 (mod N) and 2(N�1)/2 ⌘ 1 (mod N)

• It su�ces to prove v(N+1)/2 ⌘ �2 (mod N).

• 2 ±p

3 = ((p

2 ±p

6)/2)2

v(N+1)/2 =

p2 +

p6

2

!N+1

+

p2 �

p6

2

!N+1

= 2�N(N+1)/2X

j=0

✓N + 1

2j

◆p2

N+1�2jp6

2j

= 2(1�N)/2(N+1)/2X

j=0

✓N + 1

2j

◆3j

• 2(N�1)/2v(N+1)/2 ⌘ 1 + 3(N+1)/2 ⌘ �2 (mod N)

( (= ): Note that this is the important direction!

( =) ):

• 3(N�1)/2 ⌘ �1 (mod N) and 2(N�1)/2 ⌘ 1 (mod N)

• It su�ces to prove v(N+1)/2 ⌘ �2 (mod N).

• 2 ±p

3 = ((p

2 ±p

6)/2)2

v(N+1)/2 =

p2 +

p6

2

!N+1

+

p2 �

p6

2

!N+1

= 2�N(N+1)/2X

j=0

✓N + 1

2j

◆p2

N+1�2jp6

2j

= 2(1�N)/2(N+1)/2X

j=0

✓N + 1

2j

◆3j

• 2(N�1)/2v(N+1)/2 ⌘ 1 + 3(N+1)/2 ⌘ �2 (mod N)

Definition. A Mersenne prime is a prime of the form 2n � 1.

• Equivalently, . . . of the form 2p � 1 where p is a prime.

• Mersenne primes are related to perfect numbers. Eulershowed that �(m) = 2m, where m is even if and only ifm = 2p�1(2p � 1) where p and 2p � 1 are primes.

• The largest known prime is 257885161 � 1.

un =(2 +

p3)n � (2 �

p3)n

p12

and vn = (2+p

3)n+(2�p

3)n

• (2±p

3)2�1 = ±p

12 (2±p

3) (all signs the same)

• vn = un+1 � un�1 and um+n = umun+1 � um�1un

• If pe|un with e � 1, then

ukn ⌘ kuk�1n+1un (mod pe+1) and ukn+1 ⌘ uk

n+1 (mod pe+1).

u(k+1)n = uknun+1 � ukn�1un = uknun+1 + un(ukn+1 � 4ukn)

• If pe|un with e � 1, then pe+1|upn.

• 8 primes p, 9 " = "p 2 {�1, 0, 1} such that p|up+".

u0 = 0, u1 = 1, u2 = 4, u3 = 15, . . . ("2 = "3 = 0)

un =

bn�12 cX

k=0

✓n

2k + 1

◆2n�2k�13k, vn =

bn/2cX

k=0

✓n

2k

◆2n�2k+13k

up ⌘ 3(p�1)/2 ⌘ ±1 (mod p) and vp ⌘ 4 (mod p)

sfds

• (2±p

3)2�1 = ±p

12 (2±p

3) (all signs the same)

• vn = un+1 � un�1 and um+n = umun+1 � um�1un

• If pe|un with e � 1, then

ukn ⌘ kuk�1n+1un (mod pe+1) and ukn+1 ⌘ uk

n+1 (mod pe+1).

u(k+1)n = uknun+1 � ukn�1un = uknun+1 + un(ukn+1 � 4ukn)

• If pe|un with e � 1, then pe+1|upn.

• 8 primes p, 9 " = "p 2 {�1, 0, 1} such that p|up+".

u0 = 0, u1 = 1, u2 = 4, u3 = 15, . . . ("2 = "3 = 0)

un =

bn�12 cX

k=0

✓n

2k + 1

◆2n�2k�13k, vn =

bn/2cX

k=0

✓n

2k

◆2n�2k+13k

up ⌘ 3(p�1)/2 ⌘ ±1 (mod p) and vp ⌘ 4 (mod p)

sfds

• (2±p

3)2�1 = ±p

12 (2±p

3) (all signs the same)

• vn = un+1 � un�1 and um+n = umun+1 � um�1un

• If pe|un with e � 1, then

ukn ⌘ kuk�1n+1un (mod pe+1) and ukn+1 ⌘ uk

n+1 (mod pe+1).

u(k+1)n = uknun+1 � ukn�1un = uknun+1 + un(ukn+1 � 4ukn)

• If pe|un with e � 1, then pe+1|upn.

• 8 primes p, 9 " = "p 2 {�1, 0, 1} such that p|up+".

u0 = 0, u1 = 1, u2 = 4, u3 = 15, . . . ("2 = "3 = 0)

un =

bn�12 cX

k=0

✓n

2k + 1

◆2n�2k�13k, vn =

bn/2cX

k=0

✓n

2k

◆2n�2k+13k

up ⌘ 3(p�1)/2 ⌘ ±1 (mod p) and vp ⌘ 4 (mod p)

sfds

• (2±p

3)2�1 = ±p

12 (2±p

3) (all signs the same)

• vn = un+1 � un�1 and um+n = umun+1 � um�1un

• If pe|un with e � 1, then

ukn ⌘ kuk�1n+1un (mod pe+1) and ukn+1 ⌘ uk

n+1 (mod pe+1).

u(k+1)n = uknun+1 � ukn�1un = uknun+1 + un(ukn+1 � 4ukn)

• If pe|un with e � 1, then pe+1|upn.

• 8 primes p, 9 " = "p 2 {�1, 0, 1} such that p|up+".

u0 = 0, u1 = 1, u2 = 4, u3 = 15, . . . ("2 = "3 = 0)

un =

bn�12 cX

k=0

✓n

2k + 1

◆2n�2k�13k, vn =

bn/2cX

k=0

✓n

2k

◆2n�2k+13k

up ⌘ 3(p�1)/2 ⌘ ±1 (mod p) and vp ⌘ 4 (mod p)

sfds

Suppose n ⌘ 7 (mod 4) isprime. We can take P = 4.

v1 = 4, v2 = 14, . . . v2n+1 = v22n � 2 (n � 0)

Ln = v2n

N = 2p � 1 is a prime () v(N+1)/4 is divisible by N

BEWARE BAD NOTATION

u0 = 0, u1 = 1, un+1 = Pun � Qun�1 = 4un � un�1

v0 = 2, v1 = P = 4, vn+1 = 4vn � vn�1

Dun = 2vn+1 � Pvn =) 6un = vn+1 � 2vn

277232917 � 1

p 6= p

Future Homework

Page 5: people.math.sc.edu...Mersenne Primes The Lucas-Lehmer Test. Let p be an odd prime, and define recursively L 0 =4 and L n+1 = L 2 n 2 (mod (2 p 1)) for n 0. Then 2p 1 is a prime if

Suppose n ⌘ 7 (mod 4) isprime. We can take P = 4.

v1 = 4, v2 = 14, . . . v2n+1 = v22n � 2 (n � 0)

( (= ):

( =) ):

• 3(N�1)/2 ⌘ �1 (mod N) and 2(N�1)/2 ⌘ 1 (mod N)

• It su�ces to prove v(N+1)/2 ⌘ �2 (mod N).

• 2 ±p

3 = ((p

2 ±p

6)/2)2

v(N+1)/2 =

p2 +

p6

2

!N+1

+

p2 �

p6

2

!N+1

= 2�N(N+1)/2X

j=0

✓N + 1

2j

◆p2

N+1�2jp6

2j

= 2(1�N)/2(N+1)/2X

j=0

✓N + 1

2j

◆3j

• 2(N�1)/2v(N+1)/2 ⌘ 1 + 3(N+1)/2 ⌘ �2 (mod N)

( (= ): Note that this is the important direction!

( =) ):

• 3(N�1)/2 ⌘ �1 (mod N) and 2(N�1)/2 ⌘ 1 (mod N)

• It su�ces to prove v(N+1)/2 ⌘ �2 (mod N).

• 2 ±p

3 = ((p

2 ±p

6)/2)2

v(N+1)/2 =

p2 +

p6

2

!N+1

+

p2 �

p6

2

!N+1

= 2�N(N+1)/2X

j=0

✓N + 1

2j

◆p2

N+1�2jp6

2j

= 2(1�N)/2(N+1)/2X

j=0

✓N + 1

2j

◆3j

• 2(N�1)/2v(N+1)/2 ⌘ 1 + 3(N+1)/2 ⌘ �2 (mod N)

Definition. A Mersenne prime is a prime of the form 2n � 1.

• Equivalently, . . . of the form 2p � 1 where p is a prime.

• Mersenne primes are related to perfect numbers. Eulershowed that �(m) = 2m, where m is even if and only ifm = 2p�1(2p � 1) where p and 2p � 1 are primes.

• The largest known prime is 257885161 � 1.

un =(2 +

p3)n � (2 �

p3)n

p12

and vn = (2+p

3)n+(2�p

3)n

• (2±p

3)2�1 = ±p

12 (2±p

3) (all signs the same)

• vn = un+1 � un�1 and um+n = umun+1 � um�1un

• If pe|un with e � 1, then

ukn ⌘ kuk�1n+1un (mod pe+1) and ukn+1 ⌘ uk

n+1 (mod pe+1).

u(k+1)n = uknun+1 � ukn�1un = uknun+1 + un(ukn+1 � 4ukn)

• If pe|un with e � 1, then pe+1|upn.

• 8 primes p, 9 " = "p 2 {�1, 0, 1} such that p|up+".

u0 = 0, u1 = 1, u2 = 4, u3 = 15, . . . ("2 = "3 = 0)

un =

bn�12 cX

k=0

✓n

2k + 1

◆2n�2k�13k, vn =

bn/2cX

k=0

✓n

2k

◆2n�2k+13k

up ⌘ 3(p�1)/2 ⌘ ±1 (mod p) and vp ⌘ 4 (mod p)

sfds

• (2±p

3)2�1 = ±p

12 (2±p

3) (all signs the same)

• vn = un+1 � un�1 and um+n = umun+1 � um�1un

• If pe|un with e � 1, then

ukn ⌘ kuk�1n+1un (mod pe+1) and ukn+1 ⌘ uk

n+1 (mod pe+1).

u(k+1)n = uknun+1 � ukn�1un = uknun+1 + un(ukn+1 � 4ukn)

• If pe|un with e � 1, then pe+1|upn.

• 8 primes p, 9 " = "p 2 {�1, 0, 1} such that p|up+".

u0 = 0, u1 = 1, u2 = 4, u3 = 15, . . . ("2 = "3 = 0)

un =

bn�12 cX

k=0

✓n

2k + 1

◆2n�2k�13k, vn =

bn/2cX

k=0

✓n

2k

◆2n�2k+13k

up ⌘ 3(p�1)/2 ⌘ ±1 (mod p) and vp ⌘ 4 (mod p)

sfds

• (2±p

3)2�1 = ±p

12 (2±p

3) (all signs the same)

• vn = un+1 � un�1 and um+n = umun+1 � um�1un

• If pe|un with e � 1, then

ukn ⌘ kuk�1n+1un (mod pe+1) and ukn+1 ⌘ uk

n+1 (mod pe+1).

u(k+1)n = uknun+1 � ukn�1un = uknun+1 + un(ukn+1 � 4ukn)

• If pe|un with e � 1, then pe+1|upn.

• 8 primes p, 9 " = "p 2 {�1, 0, 1} such that p|up+".

u0 = 0, u1 = 1, u2 = 4, u3 = 15, . . . ("2 = "3 = 0)

un =

bn�12 cX

k=0

✓n

2k + 1

◆2n�2k�13k, vn =

bn/2cX

k=0

✓n

2k

◆2n�2k+13k

up ⌘ 3(p�1)/2 ⌘ ±1 (mod p) and vp ⌘ 4 (mod p)

sfds

• (2±p

3)2�1 = ±p

12 (2±p

3) (all signs the same)

• vn = un+1 � un�1 and um+n = umun+1 � um�1un

• If pe|un with e � 1, then

ukn ⌘ kuk�1n+1un (mod pe+1) and ukn+1 ⌘ uk

n+1 (mod pe+1).

u(k+1)n = uknun+1 � ukn�1un = uknun+1 + un(ukn+1 � 4ukn)

• If pe|un with e � 1, then pe+1|upn.

• 8 primes p, 9 " = "p 2 {�1, 0, 1} such that p|up+".

u0 = 0, u1 = 1, u2 = 4, u3 = 15, . . . ("2 = "3 = 0)

un =

bn�12 cX

k=0

✓n

2k + 1

◆2n�2k�13k, vn =

bn/2cX

k=0

✓n

2k

◆2n�2k+13k

up ⌘ 3(p�1)/2 ⌘ ±1 (mod p) and vp ⌘ 4 (mod p)

sfds

• (2±p

3)2�1 = ±p

12 (2±p

3) (all signs the same)

• vn = un+1 � un�1 and um+n = umun+1 � um�1un

• If pe|un with e � 1, then

ukn ⌘ kuk�1n+1un (mod pe+1) and ukn+1 ⌘ uk

n+1 (mod pe+1).

u(k+1)n = uknun+1 � ukn�1un = uknun+1 + un(ukn+1 � 4ukn)

• If pe|un with e � 1, then pe+1|upn.

• 8 primes p, 9 " = "p 2 {�1, 0, 1} such that p|up+".

u0 = 0, u1 = 1, u2 = 4, u3 = 15, . . . ("2 = "3 = 0)

un =

bn�12 cX

k=0

✓n

2k + 1

◆2n�2k�13k, vn =

bn/2cX

k=0

✓n

2k

◆2n�2k+13k

up ⌘ 3(p�1)/2 ⌘ ±1 (mod p) and vp ⌘ 4 (mod p)

sfds

• (2±p

3)2�1 = ±p

12 (2±p

3) (all signs the same)

• vn = un+1 � un�1 and um+n = umun+1 � um�1un

• If pe|un with e � 1, then

ukn ⌘ kuk�1n+1un (mod pe+1) and ukn+1 ⌘ uk

n+1 (mod pe+1).

u(k+1)n = uknun+1 � ukn�1un = uknun+1 + un(ukn+1 � 4ukn)

• If pe|un with e � 1, then pe+1|upn.

• 8 primes p, 9 " = "p 2 {�1, 0, 1} such that p|up+".

u0 = 0, u1 = 1, u2 = 4, u3 = 15, . . . ("2 = "3 = 0)

un =

bn�12 cX

k=0

✓n

2k + 1

◆2n�2k�13k, vn =

bn/2cX

k=0

✓n

2k

◆2n�2k+13k

up ⌘ 3(p�1)/2 ⌘ ±1 (mod p) and vp ⌘ 4 (mod p)

sfds

Suppose n ⌘ 7 (mod 4) isprime. We can take P = 4.

v1 = 4, v2 = 14, . . . v2n+1 = v22n � 2 (n � 0)

Ln = v2n

N = 2p � 1 is a prime () v(N+1)/4 is divisible by N

Page 6: people.math.sc.edu...Mersenne Primes The Lucas-Lehmer Test. Let p be an odd prime, and define recursively L 0 =4 and L n+1 = L 2 n 2 (mod (2 p 1)) for n 0. Then 2p 1 is a prime if

Suppose n ⌘ 7 (mod 4) isprime. We can take P = 4.

v1 = 4, v2 = 14, . . . v2n+1 = v22n � 2 (n � 0)

Definition. A Mersenne prime is a prime of the form 2n � 1.

• Equivalently, . . . of the form 2p � 1 where p is a prime.

• Mersenne primes are related to perfect numbers. Eulershowed that �(m) = 2m, where m is even if and only ifm = 2p�1(2p � 1) where p and 2p � 1 are primes.

• The largest known prime is 257885161 � 1.

un =(2 +

p3)n � (2 �

p3)n

p12

and vn = (2+p

3)n+(2�p

3)n• (2±

p3)2�1 = ±

p12 (2±

p3) (all signs the same)

• vn = un+1 � un�1 and um+n = umun+1 � um�1un

• If pe|un with e � 1, then

ukn ⌘ kuk�1n+1un (mod pe+1) and ukn+1 ⌘ uk

n+1 (mod pe+1).

u(k+1)n = uknun+1 � ukn�1un = uknun+1 + un(ukn+1 � 4ukn)

• If pe|un with e � 1, then pe+1|upn.

• 8 primes p, 9 " = "p 2 {�1, 0, 1} such that p|up+".

u0 = 0, u1 = 1, u2 = 4, u3 = 15, . . . ("2 = "3 = 0)

un =

bn�12 cX

k=0

✓n

2k + 1

◆2n�2k�13k, vn =

bn/2cX

k=0

✓n

2k

◆2n�2k+13k

up ⌘ 3(p�1)/2 ⌘ ±1 (mod p) and vp ⌘ 4 (mod p)

sfds

• (2±p

3)2�1 = ±p

12 (2±p

3) (all signs the same)

• vn = un+1 � un�1 and um+n = umun+1 � um�1un

• If pe|un with e � 1, then

ukn ⌘ kuk�1n+1un (mod pe+1) and ukn+1 ⌘ uk

n+1 (mod pe+1).

u(k+1)n = uknun+1 � ukn�1un = uknun+1 + un(ukn+1 � 4ukn)

• If pe|un with e � 1, then pe+1|upn.

• 8 primes p, 9 " = "p 2 {�1, 0, 1} such that p|up+".

u0 = 0, u1 = 1, u2 = 4, u3 = 15, . . . ("2 = "3 = 0)

un =

bn�12 cX

k=0

✓n

2k + 1

◆2n�2k�13k, vn =

bn/2cX

k=0

✓n

2k

◆2n�2k+13k

up ⌘ 3(p�1)/2 ⌘ ±1 (mod p) and vp ⌘ 4 (mod p)

sfds

• (2±p

3)2�1 = ±p

12 (2±p

3) (all signs the same)

• vn = un+1 � un�1 and um+n = umun+1 � um�1un

• If pe|un with e � 1, then

ukn ⌘ kuk�1n+1un (mod pe+1) and ukn+1 ⌘ uk

n+1 (mod pe+1).

u(k+1)n = uknun+1 � ukn�1un = uknun+1 + un(ukn+1 � 4ukn)

• If pe|un with e � 1, then pe+1|upn.

• 8 primes p, 9 " = "p 2 {�1, 0, 1} such that p|up+".

u0 = 0, u1 = 1, u2 = 4, u3 = 15, . . . ("2 = "3 = 0)

un =

bn�12 cX

k=0

✓n

2k + 1

◆2n�2k�13k, vn =

bn/2cX

k=0

✓n

2k

◆2n�2k+13k

up ⌘ 3(p�1)/2 ⌘ ±1 (mod p) and vp ⌘ 4 (mod p)

sfds

• (2±p

3)2�1 = ±p

12 (2±p

3) (all signs the same)

• vn = un+1 � un�1 and um+n = umun+1 � um�1un

• If pe|un with e � 1, then

ukn ⌘ kuk�1n+1un (mod pe+1) and ukn+1 ⌘ uk

n+1 (mod pe+1).

u(k+1)n = uknun+1 � ukn�1un = uknun+1 + un(ukn+1 � 4ukn)

• If pe|un with e � 1, then pe+1|upn.

• 8 primes p, 9 " = "p 2 {�1, 0, 1} such that p|up+".

u0 = 0, u1 = 1, u2 = 4, u3 = 15, . . . ("2 = "3 = 0)

un =

bn�12 cX

k=0

✓n

2k + 1

◆2n�2k�13k, vn =

bn/2cX

k=0

✓n

2k

◆2n�2k+13k

up ⌘ 3(p�1)/2 ⌘ ±1 (mod p) and vp ⌘ 4 (mod p)

sfds

• (2±p

3)2�1 = ±p

12 (2±p

3) (all signs the same)

• vn = un+1 � un�1 and um+n = umun+1 � um�1un

• If pe|un with e � 1, then

ukn ⌘ kuk�1n+1un (mod pe+1) and ukn+1 ⌘ uk

n+1 (mod pe+1).

u(k+1)n = uknun+1 � ukn�1un = uknun+1 + un(ukn+1 � 4ukn)

• If pe|un with e � 1, then pe+1|upn.

• 8 primes p, 9 " = "p 2 {�1, 0, 1} such that p|up+".

u0 = 0, u1 = 1, u2 = 4, u3 = 15, . . . ("2 = "3 = 0)

un =

bn�12 cX

k=0

✓n

2k + 1

◆2n�2k�13k, vn =

bn/2cX

k=0

✓n

2k

◆2n�2k+13k

up ⌘ 3(p�1)/2 ⌘ ±1 (mod p) and vp ⌘ 4 (mod p)

sfds

• (2±p

3)2�1 = ±p

12 (2±p

3) (all signs the same)

• vn = un+1 � un�1 and um+n = umun+1 � um�1un

• If pe|un with e � 1, then

ukn ⌘ kuk�1n+1un (mod pe+1) and ukn+1 ⌘ uk

n+1 (mod pe+1).

u(k+1)n = uknun+1 � ukn�1un = uknun+1 + un(ukn+1 � 4ukn)

• If pe|un with e � 1, then pe+1|upn.

• 8 primes p, 9 " = "p 2 {�1, 0, 1} such that p|up+".

u0 = 0, u1 = 1, u2 = 4, u3 = 15, . . . ("2 = "3 = 0)

un =

bn�12 cX

k=0

✓n

2k + 1

◆2n�2k�13k, vn =

bn/2cX

k=0

✓n

2k

◆2n�2k+13k

up ⌘ 3(p�1)/2 ⌘ ±1 (mod p) and vp ⌘ 4 (mod p)

sfds

Suppose n ⌘ 7 (mod 4) isprime. We can take P = 4.

v1 = 4, v2 = 14, . . . v2n+1 = v22n � 2 (n � 0)

Ln = v2n

N = 2p � 1 is a prime () v(N+1)/4 is divisible by N

Page 7: people.math.sc.edu...Mersenne Primes The Lucas-Lehmer Test. Let p be an odd prime, and define recursively L 0 =4 and L n+1 = L 2 n 2 (mod (2 p 1)) for n 0. Then 2p 1 is a prime if

Suppose n ⌘ 7 (mod 4) isprime. We can take P = 4.

v1 = 4, v2 = 14, . . . v2n+1 = v22n � 2 (n � 0)

Definition. A Mersenne prime is a prime of the form 2n � 1.

• Equivalently, . . . of the form 2p � 1 where p is a prime.

• Mersenne primes are related to perfect numbers. Eulershowed that �(m) = 2m, where m is even if and only ifm = 2p�1(2p � 1) where p and 2p � 1 are primes.

• The largest known prime is 257885161 � 1.

un =(2 +

p3)n � (2 �

p3)n

p12

and vn = (2+p

3)n+(2�p

3)n• (2±

p3)2�1 = ±

p12 (2±

p3) (all signs the same)

• vn = un+1 � un�1 and um+n = umun+1 � um�1un

• If pe|un with e � 1, then

ukn ⌘ kuk�1n+1un (mod pe+1) and ukn+1 ⌘ uk

n+1 (mod pe+1).

u(k+1)n = uknun+1 � ukn�1un = uknun+1 + un(ukn+1 � 4ukn)

• If pe|un with e � 1, then pe+1|upn.

• 8 primes p, 9 " = "p 2 {�1, 0, 1} such that p|up+".

u0 = 0, u1 = 1, u2 = 4, u3 = 15, . . . ("2 = "3 = 0)

un =

bn�12 cX

k=0

✓n

2k + 1

◆2n�2k�13k, vn =

bn/2cX

k=0

✓n

2k

◆2n�2k+13k

up ⌘ 3(p�1)/2 ⌘ ±1 (mod p) and vp ⌘ 4 (mod p)

sfds

• (2±p

3)2�1 = ±p

12 (2±p

3) (all signs the same)

• vn = un+1 � un�1 and um+n = umun+1 � um�1un

• If pe|un with e � 1, then

ukn ⌘ kuk�1n+1un (mod pe+1) and ukn+1 ⌘ uk

n+1 (mod pe+1).

u(k+1)n = uknun+1 � ukn�1un = uknun+1 + un(ukn+1 � 4ukn)

• If pe|un with e � 1, then pe+1|upn.

• 8 primes p, 9 " = "p 2 {�1, 0, 1} such that p|up+".

u0 = 0, u1 = 1, u2 = 4, u3 = 15, . . . ("2 = "3 = 0)

un =

bn�12 cX

k=0

✓n

2k + 1

◆2n�2k�13k, vn =

bn/2cX

k=0

✓n

2k

◆2n�2k+13k

up ⌘ 3(p�1)/2 ⌘ ±1 (mod p) and vp ⌘ 4 (mod p)

sfds

• (2±p

3)2�1 = ±p

12 (2±p

3) (all signs the same)

• vn = un+1 � un�1 and um+n = umun+1 � um�1un

• If pe|un with e � 1, then

ukn ⌘ kuk�1n+1un (mod pe+1) and ukn+1 ⌘ uk

n+1 (mod pe+1).

u(k+1)n = uknun+1 � ukn�1un = uknun+1 + un(ukn+1 � 4ukn)

• If pe|un with e � 1, then pe+1|upn.

• 8 primes p, 9 " = "p 2 {�1, 0, 1} such that p|up+".

u0 = 0, u1 = 1, u2 = 4, u3 = 15, . . . ("2 = "3 = 0)

un =

bn�12 cX

k=0

✓n

2k + 1

◆2n�2k�13k, vn =

bn/2cX

k=0

✓n

2k

◆2n�2k+13k

up ⌘ 3(p�1)/2 ⌘ ±1 (mod p) and vp ⌘ 4 (mod p)

sfds

• (2±p

3)2�1 = ±p

12 (2±p

3) (all signs the same)

• vn = un+1 � un�1 and um+n = umun+1 � um�1un

• If pe|un with e � 1, then

ukn ⌘ kuk�1n+1un (mod pe+1) and ukn+1 ⌘ uk

n+1 (mod pe+1).

u(k+1)n = uknun+1 � ukn�1un = uknun+1 + un(ukn+1 � 4ukn)

• If pe|un with e � 1, then pe+1|upn.

• 8 primes p, 9 " = "p 2 {�1, 0, 1} such that p|up+".

u0 = 0, u1 = 1, u2 = 4, u3 = 15, . . . ("2 = "3 = 0)

un =

bn�12 cX

k=0

✓n

2k + 1

◆2n�2k�13k, vn =

bn/2cX

k=0

✓n

2k

◆2n�2k+13k

up ⌘ 3(p�1)/2 ⌘ ±1 (mod p) and vp ⌘ 4 (mod p)

up�1 ⌘ 4up � up+1 ⌘ 4up � vp � up�1 ⌘ �up�1 (mod p)

Suppose n ⌘ 7 (mod 4) isprime. We can take P = 4.

v1 = 4, v2 = 14, . . . v2n+1 = v22n � 2 (n � 0)

Ln = v2n

N = 2p � 1 is a prime () v(N+1)/4 is divisible by N

• (2±p

3)2�1 = ±p

12 (2±p

3) (all signs the same)

• vn = un+1 � un�1 and um+n = umun+1 � um�1un

• If pe|un with e � 1, then

ukn ⌘ kuk�1n+1un (mod pe+1) and ukn+1 ⌘ uk

n+1 (mod pe+1).

u(k+1)n = uknun+1 � ukn�1un = uknun+1 + un(ukn+1 � 4ukn)

• If pe|un with e � 1, then pe+1|upn.

• 8 primes p, 9 " = "p 2 {�1, 0, 1} such that p|up+".

u0 = 0, u1 = 1, u2 = 4, u3 = 15, . . . ("2 = "3 = 0)

un =

bn�12 cX

k=0

✓n

2k + 1

◆2n�2k�13k, vn =

bn/2cX

k=0

✓n

2k

◆2n�2k+13k

up ⌘ 3(p�1)/2 ⌘ ±1 (mod p) and vp ⌘ 4 (mod p)

sfds

Page 8: people.math.sc.edu...Mersenne Primes The Lucas-Lehmer Test. Let p be an odd prime, and define recursively L 0 =4 and L n+1 = L 2 n 2 (mod (2 p 1)) for n 0. Then 2p 1 is a prime if

Suppose n ⌘ 7 (mod 4) isprime. We can take P = 4.

v1 = 4, v2 = 14, . . . v2n+1 = v22n � 2 (n � 0)

Definition. A Mersenne prime is a prime of the form 2n � 1.

• Equivalently, . . . of the form 2p � 1 where p is a prime.

• Mersenne primes are related to perfect numbers. Eulershowed that �(m) = 2m, where m is even if and only ifm = 2p�1(2p � 1) where p and 2p � 1 are primes.

• The largest known prime is 257885161 � 1.

un =(2 +

p3)n � (2 �

p3)n

p12

and vn = (2+p

3)n+(2�p

3)n• (2±

p3)2�1 = ±

p12 (2±

p3) (all signs the same)

• vn = un+1 � un�1 and um+n = umun+1 � um�1un

• If pe|un with e � 1, then

ukn ⌘ kuk�1n+1un (mod pe+1) and ukn+1 ⌘ uk

n+1 (mod pe+1).

u(k+1)n = uknun+1 � ukn�1un = uknun+1 + un(ukn+1 � 4ukn)

• If pe|un with e � 1, then pe+1|upn.

• 8 primes p, 9 " = "p 2 {�1, 0, 1} such that p|up+".

u0 = 0, u1 = 1, u2 = 4, u3 = 15, . . . ("2 = "3 = 0)

un =

bn�12 cX

k=0

✓n

2k + 1

◆2n�2k�13k, vn =

bn/2cX

k=0

✓n

2k

◆2n�2k+13k

up ⌘ 3(p�1)/2 ⌘ ±1 (mod p) and vp ⌘ 4 (mod p)

sfds

• (2±p

3)2�1 = ±p

12 (2±p

3) (all signs the same)

• vn = un+1 � un�1 and um+n = umun+1 � um�1un

• If pe|un with e � 1, then

ukn ⌘ kuk�1n+1un (mod pe+1) and ukn+1 ⌘ uk

n+1 (mod pe+1).

u(k+1)n = uknun+1 � ukn�1un = uknun+1 + un(ukn+1 � 4ukn)

• If pe|un with e � 1, then pe+1|upn.

• 8 primes p, 9 " = "p 2 {�1, 0, 1} such that p|up+".

u0 = 0, u1 = 1, u2 = 4, u3 = 15, . . . ("2 = "3 = 0)

un =

bn�12 cX

k=0

✓n

2k + 1

◆2n�2k�13k, vn =

bn/2cX

k=0

✓n

2k

◆2n�2k+13k

up ⌘ 3(p�1)/2 ⌘ ±1 (mod p) and vp ⌘ 4 (mod p)

sfds

• (2±p

3)2�1 = ±p

12 (2±p

3) (all signs the same)

• vn = un+1 � un�1 and um+n = umun+1 � um�1un

• If pe|un with e � 1, then

ukn ⌘ kuk�1n+1un (mod pe+1) and ukn+1 ⌘ uk

n+1 (mod pe+1).

u(k+1)n = uknun+1 � ukn�1un = uknun+1 + un(ukn+1 � 4ukn)

• If pe|un with e � 1, then pe+1|upn.

• 8 primes p, 9 " = "p 2 {�1, 0, 1} such that p|up+".

u0 = 0, u1 = 1, u2 = 4, u3 = 15, . . . ("2 = "3 = 0)

un =

bn�12 cX

k=0

✓n

2k + 1

◆2n�2k�13k, vn =

bn/2cX

k=0

✓n

2k

◆2n�2k+13k

up ⌘ 3(p�1)/2 ⌘ ±1 (mod p) and vp ⌘ 4 (mod p)

sfds

• (2±p

3)2�1 = ±p

12 (2±p

3) (all signs the same)

• vn = un+1 � un�1 and um+n = umun+1 � um�1un

• If pe|un with e � 1, then

ukn ⌘ kuk�1n+1un (mod pe+1) and ukn+1 ⌘ uk

n+1 (mod pe+1).

u(k+1)n = uknun+1 � ukn�1un = uknun+1 + un(ukn+1 � 4ukn)

• If pe|un with e � 1, then pe+1|upn.

• 8 primes p, 9 " = "p 2 {�1, 0, 1} such that p|up+".

u0 = 0, u1 = 1, u2 = 4, u3 = 15, . . . ("2 = "3 = 0)

un =

bn�12 cX

k=0

✓n

2k + 1

◆2n�2k�13k, vn =

bn/2cX

k=0

✓n

2k

◆2n�2k+13k

up ⌘ 3(p�1)/2 ⌘ ±1 (mod p) and vp ⌘ 4 (mod p)

up�1 ⌘ 4up � up+1 ⌘ 4up � vp � up�1 ⌘ �up�1 (mod p)

• (2±p

3)2�1 = ±p

12 (2±p

3) (all signs the same)

• vn = un+1 � un�1 and um+n = umun+1 � um�1un

• If pe|un with e � 1, then

ukn ⌘ kuk�1n+1un (mod pe+1) and ukn+1 ⌘ uk

n+1 (mod pe+1).

u(k+1)n = uknun+1 � ukn�1un = uknun+1 + un(ukn+1 � 4ukn)

• If pe|un with e � 1, then pe+1|upn.

• 8 primes p, 9 " = "p 2 {�1, 0, 1} such that p|up+".

u0 = 0, u1 = 1, u2 = 4, u3 = 15, . . . ("2 = "3 = 0)

un =

bn�12 cX

k=0

✓n

2k + 1

◆2n�2k�13k, vn =

bn/2cX

k=0

✓n

2k

◆2n�2k+13k

up ⌘ 3(p�1)/2 ⌘ ±1 (mod p) and vp ⌘ 4 (mod p)

up�1 ⌘ 4up � up+1 ⌘ 4up � vp � up�1 ⌘ �up�1 (mod p)

up+1 ⌘ 4up � up�1 ⌘ 4up + vp � up+1 ⌘ �up+1 (mod p)

Suppose n ⌘ 7 (mod 4) isprime. We can take P = 4.

v1 = 4, v2 = 14, . . . v2n+1 = v22n � 2 (n � 0)

Ln = v2n

N = 2p � 1 is a prime () v(N+1)/4 is divisible by N

• (2±p

3)2�1 = ±p

12 (2±p

3) (all signs the same)

• vn = un+1 � un�1 and um+n = umun+1 � um�1un

• If pe|un with e � 1, then

ukn ⌘ kuk�1n+1un (mod pe+1) and ukn+1 ⌘ uk

n+1 (mod pe+1).

u(k+1)n = uknun+1 � ukn�1un = uknun+1 + un(ukn+1 � 4ukn)

• If pe|un with e � 1, then pe+1|upn.

• 8 primes p, 9 " = "p 2 {�1, 0, 1} such that p|up+".

u0 = 0, u1 = 1, u2 = 4, u3 = 15, . . . ("2 = "3 = 0)

un =

bn�12 cX

k=0

✓n

2k + 1

◆2n�2k�13k, vn =

bn/2cX

k=0

✓n

2k

◆2n�2k+13k

up ⌘ 3(p�1)/2 ⌘ ±1 (mod p) and vp ⌘ 4 (mod p)

sfds

Page 9: people.math.sc.edu...Mersenne Primes The Lucas-Lehmer Test. Let p be an odd prime, and define recursively L 0 =4 and L n+1 = L 2 n 2 (mod (2 p 1)) for n 0. Then 2p 1 is a prime if

Suppose n ⌘ 7 (mod 4) isprime. We can take P = 4.

v1 = 4, v2 = 14, . . . v2n+1 = v22n � 2 (n � 0)

Definition. A Mersenne prime is a prime of the form 2n � 1.

• Equivalently, . . . of the form 2p � 1 where p is a prime.

• Mersenne primes are related to perfect numbers. Eulershowed that �(m) = 2m, where m is even if and only ifm = 2p�1(2p � 1) where p and 2p � 1 are primes.

• The largest known prime is 257885161 � 1.

un =(2 +

p3)n � (2 �

p3)n

p12

and vn = (2+p

3)n+(2�p

3)n• (2±

p3)2�1 = ±

p12 (2±

p3) (all signs the same)

• vn = un+1 � un�1 and um+n = umun+1 � um�1un

• If pe|un with e � 1, then

ukn ⌘ kuk�1n+1un (mod pe+1) and ukn+1 ⌘ uk

n+1 (mod pe+1).

u(k+1)n = uknun+1 � ukn�1un = uknun+1 + un(ukn+1 � 4ukn)

• If pe|un with e � 1, then pe+1|upn.

• 8 primes p, 9 " = "p 2 {�1, 0, 1} such that p|up+".

u0 = 0, u1 = 1, u2 = 4, u3 = 15, . . . ("2 = "3 = 0)

un =

bn�12 cX

k=0

✓n

2k + 1

◆2n�2k�13k, vn =

bn/2cX

k=0

✓n

2k

◆2n�2k+13k

up ⌘ 3(p�1)/2 ⌘ ±1 (mod p) and vp ⌘ 4 (mod p)

sfds

• (2±p

3)2�1 = ±p

12 (2±p

3) (all signs the same)

• vn = un+1 � un�1 and um+n = umun+1 � um�1un

• If pe|un with e � 1, then

ukn ⌘ kuk�1n+1un (mod pe+1) and ukn+1 ⌘ uk

n+1 (mod pe+1).

u(k+1)n = uknun+1 � ukn�1un = uknun+1 + un(ukn+1 � 4ukn)

• If pe|un with e � 1, then pe+1|upn.

• 8 primes p, 9 " = "p 2 {�1, 0, 1} such that p|up+".

u0 = 0, u1 = 1, u2 = 4, u3 = 15, . . . ("2 = "3 = 0)

un =

bn�12 cX

k=0

✓n

2k + 1

◆2n�2k�13k, vn =

bn/2cX

k=0

✓n

2k

◆2n�2k+13k

up ⌘ 3(p�1)/2 ⌘ ±1 (mod p) and vp ⌘ 4 (mod p)

sfds

• (2±p

3)2�1 = ±p

12 (2±p

3) (all signs the same)

• vn = un+1 � un�1 and um+n = umun+1 � um�1un

• If pe|un with e � 1, then

ukn ⌘ kuk�1n+1un (mod pe+1) and ukn+1 ⌘ uk

n+1 (mod pe+1).

u(k+1)n = uknun+1 � ukn�1un = uknun+1 + un(ukn+1 � 4ukn)

• If pe|un with e � 1, then pe+1|upn.

• 8 primes p, 9 " = "p 2 {�1, 0, 1} such that p|up+".

u0 = 0, u1 = 1, u2 = 4, u3 = 15, . . . ("2 = "3 = 0)

un =

bn�12 cX

k=0

✓n

2k + 1

◆2n�2k�13k, vn =

bn/2cX

k=0

✓n

2k

◆2n�2k+13k

up ⌘ 3(p�1)/2 ⌘ ±1 (mod p) and vp ⌘ 4 (mod p)

sfds

• gcd(un, un+1) = 1 and gcd(un, vn) 2

• For m 2 Z+, if ↵ = ↵(m) is minimal such that u↵ ⌘ 0(mod m), then un ⌘ 0 (mod m) () ↵|n.

Suppose n ⌘ 7 (mod 4) isprime. We can take P = 4.

v1 = 4, v2 = 14, . . . v2n+1 = v22n � 2 (n � 0)

Ln = v2n

N = 2p � 1 is a prime () v(N+1)/4 is divisible by N

u0 = 0, u1 = 1, un+1 = Pun � Qun�1 = 4un � un�1

v0 = 2, v1 = P = 4, vn+1 = 4vn � vn�1

Dun = 2vn+1 � Pvn =) 6un = vn+1 � 2vn

277232917 � 1

Page 10: people.math.sc.edu...Mersenne Primes The Lucas-Lehmer Test. Let p be an odd prime, and define recursively L 0 =4 and L n+1 = L 2 n 2 (mod (2 p 1)) for n 0. Then 2p 1 is a prime if

Suppose n ⌘ 7 (mod 4) isprime. We can take P = 4.

v1 = 4, v2 = 14, . . . v2n+1 = v22n � 2 (n � 0)

Definition. A Mersenne prime is a prime of the form 2n � 1.

• Equivalently, . . . of the form 2p � 1 where p is a prime.

• Mersenne primes are related to perfect numbers. Eulershowed that �(m) = 2m, where m is even if and only ifm = 2p�1(2p � 1) where p and 2p � 1 are primes.

• The largest known prime is 257885161 � 1.

un =(2 +

p3)n � (2 �

p3)n

p12

and vn = (2+p

3)n+(2�p

3)n• (2±

p3)2�1 = ±

p12 (2±

p3) (all signs the same)

• vn = un+1 � un�1 and um+n = umun+1 � um�1un

• If pe|un with e � 1, then

ukn ⌘ kuk�1n+1un (mod pe+1) and ukn+1 ⌘ uk

n+1 (mod pe+1).

u(k+1)n = uknun+1 � ukn�1un = uknun+1 + un(ukn+1 � 4ukn)

• If pe|un with e � 1, then pe+1|upn.

• 8 primes p, 9 " = "p 2 {�1, 0, 1} such that p|up+".

u0 = 0, u1 = 1, u2 = 4, u3 = 15, . . . ("2 = "3 = 0)

un =

bn�12 cX

k=0

✓n

2k + 1

◆2n�2k�13k, vn =

bn/2cX

k=0

✓n

2k

◆2n�2k+13k

up ⌘ 3(p�1)/2 ⌘ ±1 (mod p) and vp ⌘ 4 (mod p)

sfds

• (2±p

3)2�1 = ±p

12 (2±p

3) (all signs the same)

• vn = un+1 � un�1 and um+n = umun+1 � um�1un

• If pe|un with e � 1, then

ukn ⌘ kuk�1n+1un (mod pe+1) and ukn+1 ⌘ uk

n+1 (mod pe+1).

u(k+1)n = uknun+1 � ukn�1un = uknun+1 + un(ukn+1 � 4ukn)

• If pe|un with e � 1, then pe+1|upn.

• 8 primes p, 9 " = "p 2 {�1, 0, 1} such that p|up+".

u0 = 0, u1 = 1, u2 = 4, u3 = 15, . . . ("2 = "3 = 0)

un =

bn�12 cX

k=0

✓n

2k + 1

◆2n�2k�13k, vn =

bn/2cX

k=0

✓n

2k

◆2n�2k+13k

up ⌘ 3(p�1)/2 ⌘ ±1 (mod p) and vp ⌘ 4 (mod p)

sfds

• (2±p

3)2�1 = ±p

12 (2±p

3) (all signs the same)

• vn = un+1 � un�1 and um+n = umun+1 � um�1un

• If pe|un with e � 1, then

ukn ⌘ kuk�1n+1un (mod pe+1) and ukn+1 ⌘ uk

n+1 (mod pe+1).

u(k+1)n = uknun+1 � ukn�1un = uknun+1 + un(ukn+1 � 4ukn)

• If pe|un with e � 1, then pe+1|upn.

• 8 primes p, 9 " = "p 2 {�1, 0, 1} such that p|up+".

u0 = 0, u1 = 1, u2 = 4, u3 = 15, . . . ("2 = "3 = 0)

un =

bn�12 cX

k=0

✓n

2k + 1

◆2n�2k�13k, vn =

bn/2cX

k=0

✓n

2k

◆2n�2k+13k

up ⌘ 3(p�1)/2 ⌘ ±1 (mod p) and vp ⌘ 4 (mod p)

sfds

• gcd(un, un+1) = 1 and gcd(un, vn) 2

• For m 2 Z+, if ↵ = ↵(m) is minimal such that u↵ ⌘ 0(mod m), then un ⌘ 0 (mod m) () ↵|n.

• gcd(un, un+1) = 1 and gcd(un, vn) 2

• For m 2 Z+, if ↵ = ↵(m) is minimal such that u↵ ⌘ 0(mod m), then un ⌘ 0 (mod m) () ↵|n.

Suppose n ⌘ 7 (mod 4) isprime. We can take P = 4.

v1 = 4, v2 = 14, . . . v2n+1 = v22n � 2 (n � 0)

Ln = v2n

N = 2p � 1 is a prime () v(N+1)/4 is divisible by N

• (2±p

3)2�1 = ±p

12 (2±p

3) (all signs the same)

• vn = un+1 � un�1 and um+n = umun+1 � um�1un

• If pe|un with e � 1, then

ukn ⌘ kuk�1n+1un (mod pe+1) and ukn+1 ⌘ uk

n+1 (mod pe+1).

u(k+1)n = uknun+1 � ukn�1un = uknun+1 + un(ukn+1 � 4ukn)

• If pe|un with e � 1, then pe+1|upn.

• 8 primes p, 9 " = "p 2 {�1, 0, 1} such that p|up+".

u0 = 0, u1 = 1, u2 = 4, u3 = 15, . . . ("2 = "3 = 0)

un =

bn�12 cX

k=0

✓n

2k + 1

◆2n�2k�13k, vn =

bn/2cX

k=0

✓n

2k

◆2n�2k+13k

up ⌘ 3(p�1)/2 ⌘ ±1 (mod p) and vp ⌘ 4 (mod p)

sfds

• (2±p

3)2�1 = ±p

12 (2±p

3) (all signs the same)

• vn = un+1 � un�1 and um+n = umun+1 � um�1un

• If pe|un with e � 1, then

ukn ⌘ kuk�1n+1un (mod pe+1) and ukn+1 ⌘ uk

n+1 (mod pe+1).

u(k+1)n = uknun+1 � ukn�1un = uknun+1 + un(ukn+1 � 4ukn)

• If pe|un with e � 1, then pe+1|upn.

• 8 primes p, 9 " = "p 2 {�1, 0, 1} such that p|up+".

u0 = 0, u1 = 1, u2 = 4, u3 = 15, . . . ("2 = "3 = 0)

un =

bn�12 cX

k=0

✓n

2k + 1

◆2n�2k�13k, vn =

bn/2cX

k=0

✓n

2k

◆2n�2k+13k

up ⌘ 3(p�1)/2 ⌘ ±1 (mod p) and vp ⌘ 4 (mod p)

sfds

Page 11: people.math.sc.edu...Mersenne Primes The Lucas-Lehmer Test. Let p be an odd prime, and define recursively L 0 =4 and L n+1 = L 2 n 2 (mod (2 p 1)) for n 0. Then 2p 1 is a prime if

Suppose n ⌘ 7 (mod 4) isprime. We can take P = 4.

v1 = 4, v2 = 14, . . . v2n+1 = v22n � 2 (n � 0)

Definition. A Mersenne prime is a prime of the form 2n � 1.

• Equivalently, . . . of the form 2p � 1 where p is a prime.

• Mersenne primes are related to perfect numbers. Eulershowed that �(m) = 2m, where m is even if and only ifm = 2p�1(2p � 1) where p and 2p � 1 are primes.

• The largest known prime is 257885161 � 1.

un =(2 +

p3)n � (2 �

p3)n

p12

and vn = (2+p

3)n+(2�p

3)n• (2±

p3)2�1 = ±

p12 (2±

p3) (all signs the same)

• vn = un+1 � un�1 and um+n = umun+1 � um�1un

• If pe|un with e � 1, then

ukn ⌘ kuk�1n+1un (mod pe+1) and ukn+1 ⌘ uk

n+1 (mod pe+1).

u(k+1)n = uknun+1 � ukn�1un = uknun+1 + un(ukn+1 � 4ukn)

• If pe|un with e � 1, then pe+1|upn.

• 8 primes p, 9 " = "p 2 {�1, 0, 1} such that p|up+".

u0 = 0, u1 = 1, u2 = 4, u3 = 15, . . . ("2 = "3 = 0)

un =

bn�12 cX

k=0

✓n

2k + 1

◆2n�2k�13k, vn =

bn/2cX

k=0

✓n

2k

◆2n�2k+13k

up ⌘ 3(p�1)/2 ⌘ ±1 (mod p) and vp ⌘ 4 (mod p)

sfds

• (2±p

3)2�1 = ±p

12 (2±p

3) (all signs the same)

• vn = un+1 � un�1 and um+n = umun+1 � um�1un

• If pe|un with e � 1, then

ukn ⌘ kuk�1n+1un (mod pe+1) and ukn+1 ⌘ uk

n+1 (mod pe+1).

u(k+1)n = uknun+1 � ukn�1un = uknun+1 + un(ukn+1 � 4ukn)

• If pe|un with e � 1, then pe+1|upn.

• 8 primes p, 9 " = "p 2 {�1, 0, 1} such that p|up+".

u0 = 0, u1 = 1, u2 = 4, u3 = 15, . . . ("2 = "3 = 0)

un =

bn�12 cX

k=0

✓n

2k + 1

◆2n�2k�13k, vn =

bn/2cX

k=0

✓n

2k

◆2n�2k+13k

up ⌘ 3(p�1)/2 ⌘ ±1 (mod p) and vp ⌘ 4 (mod p)

sfds

• (2±p

3)2�1 = ±p

12 (2±p

3) (all signs the same)

• vn = un+1 � un�1 and um+n = umun+1 � um�1un

• If pe|un with e � 1, then

ukn ⌘ kuk�1n+1un (mod pe+1) and ukn+1 ⌘ uk

n+1 (mod pe+1).

u(k+1)n = uknun+1 � ukn�1un = uknun+1 + un(ukn+1 � 4ukn)

• If pe|un with e � 1, then pe+1|upn.

• 8 primes p, 9 " = "p 2 {�1, 0, 1} such that p|up+".

u0 = 0, u1 = 1, u2 = 4, u3 = 15, . . . ("2 = "3 = 0)

un =

bn�12 cX

k=0

✓n

2k + 1

◆2n�2k�13k, vn =

bn/2cX

k=0

✓n

2k

◆2n�2k+13k

up ⌘ 3(p�1)/2 ⌘ ±1 (mod p) and vp ⌘ 4 (mod p)

sfds

• gcd(un, un+1) = 1 and gcd(un, vn) 2

• For m 2 Z+, if ↵ = ↵(m) is minimal such that u↵ ⌘ 0(mod m), then un ⌘ 0 (mod m) () ↵|n.

• gcd(un, un+1) = 1 and gcd(un, vn) 2

• For m 2 Z+, if ↵ = ↵(m) is minimal such that u↵ ⌘ 0(mod m), then un ⌘ 0 (mod m) () ↵|n.

Suppose n ⌘ 7 (mod 4) isprime. We can take P = 4.

v1 = 4, v2 = 14, . . . v2n+1 = v22n � 2 (n � 0)

Ln = v2n

N = 2p � 1 is a prime () v(N+1)/4 is divisible by N

• gcd(un, un+1) = 1 and gcd(un, vn) 2

• For m 2 Z+, if ↵ = ↵(m) is minimal such that u↵ ⌘ 0(mod m), then un ⌘ 0 (mod m) () ↵|n.

• v2p�2 ⌘ 0 (mod N) =) u2p�2 6⌘ 0 (mod N)

• u2n = unvn =) u2p�1 ⌘ 0 (mod N), so ↵(2p�1) = 2p�1BEWARE WE’RE BACK TO p BEING p.

Page 12: people.math.sc.edu...Mersenne Primes The Lucas-Lehmer Test. Let p be an odd prime, and define recursively L 0 =4 and L n+1 = L 2 n 2 (mod (2 p 1)) for n 0. Then 2p 1 is a prime if

Suppose n ⌘ 7 (mod 4) isprime. We can take P = 4.

v1 = 4, v2 = 14, . . . v2n+1 = v22n � 2 (n � 0)

Definition. A Mersenne prime is a prime of the form 2n � 1.

• Equivalently, . . . of the form 2p � 1 where p is a prime.

• Mersenne primes are related to perfect numbers. Eulershowed that �(m) = 2m, where m is even if and only ifm = 2p�1(2p � 1) where p and 2p � 1 are primes.

• The largest known prime is 257885161 � 1.

un =(2 +

p3)n � (2 �

p3)n

p12

and vn = (2+p

3)n+(2�p

3)n• (2±

p3)2�1 = ±

p12 (2±

p3) (all signs the same)

• vn = un+1 � un�1 and um+n = umun+1 � um�1un

• If pe|un with e � 1, then

ukn ⌘ kuk�1n+1un (mod pe+1) and ukn+1 ⌘ uk

n+1 (mod pe+1).

u(k+1)n = uknun+1 � ukn�1un = uknun+1 + un(ukn+1 � 4ukn)

• If pe|un with e � 1, then pe+1|upn.

• 8 primes p, 9 " = "p 2 {�1, 0, 1} such that p|up+".

u0 = 0, u1 = 1, u2 = 4, u3 = 15, . . . ("2 = "3 = 0)

un =

bn�12 cX

k=0

✓n

2k + 1

◆2n�2k�13k, vn =

bn/2cX

k=0

✓n

2k

◆2n�2k+13k

up ⌘ 3(p�1)/2 ⌘ ±1 (mod p) and vp ⌘ 4 (mod p)

sfds

• (2±p

3)2�1 = ±p

12 (2±p

3) (all signs the same)

• vn = un+1 � un�1 and um+n = umun+1 � um�1un

• If pe|un with e � 1, then

ukn ⌘ kuk�1n+1un (mod pe+1) and ukn+1 ⌘ uk

n+1 (mod pe+1).

u(k+1)n = uknun+1 � ukn�1un = uknun+1 + un(ukn+1 � 4ukn)

• If pe|un with e � 1, then pe+1|upn.

• 8 primes p, 9 " = "p 2 {�1, 0, 1} such that p|up+".

u0 = 0, u1 = 1, u2 = 4, u3 = 15, . . . ("2 = "3 = 0)

un =

bn�12 cX

k=0

✓n

2k + 1

◆2n�2k�13k, vn =

bn/2cX

k=0

✓n

2k

◆2n�2k+13k

up ⌘ 3(p�1)/2 ⌘ ±1 (mod p) and vp ⌘ 4 (mod p)

sfds

• (2±p

3)2�1 = ±p

12 (2±p

3) (all signs the same)

• vn = un+1 � un�1 and um+n = umun+1 � um�1un

• If pe|un with e � 1, then

ukn ⌘ kuk�1n+1un (mod pe+1) and ukn+1 ⌘ uk

n+1 (mod pe+1).

u(k+1)n = uknun+1 � ukn�1un = uknun+1 + un(ukn+1 � 4ukn)

• If pe|un with e � 1, then pe+1|upn.

• 8 primes p, 9 " = "p 2 {�1, 0, 1} such that p|up+".

u0 = 0, u1 = 1, u2 = 4, u3 = 15, . . . ("2 = "3 = 0)

un =

bn�12 cX

k=0

✓n

2k + 1

◆2n�2k�13k, vn =

bn/2cX

k=0

✓n

2k

◆2n�2k+13k

up ⌘ 3(p�1)/2 ⌘ ±1 (mod p) and vp ⌘ 4 (mod p)

sfds

• gcd(un, un+1) = 1 and gcd(un, vn) 2

• For m 2 Z+, if ↵ = ↵(m) is minimal such that u↵ ⌘ 0(mod m), then un ⌘ 0 (mod m) () ↵|n.

• gcd(un, un+1) = 1 and gcd(un, vn) 2

• For m 2 Z+, if ↵ = ↵(m) is minimal such that u↵ ⌘ 0(mod m), then un ⌘ 0 (mod m) () ↵|n.

Suppose n ⌘ 7 (mod 4) isprime. We can take P = 4.

v1 = 4, v2 = 14, . . . v2n+1 = v22n � 2 (n � 0)

Ln = v2n

N = 2p � 1 is a prime () v(N+1)/4 is divisible by N

• gcd(un, un+1) = 1 and gcd(un, vn) 2

• For m 2 Z+, if ↵ = ↵(m) is minimal such that u↵ ⌘ 0(mod m), then un ⌘ 0 (mod m) () ↵|n.

• v2p�2 ⌘ 0 (mod N) =) u2p�2 6⌘ 0 (mod N)

• u2n = unvn =) u2p�1 ⌘ 0 (mod N), so ↵(2p�1) = 2p�1

• gcd(un, un+1) = 1 and gcd(un, vn) 2

• For m 2 Z+, if ↵ = ↵(m) is minimal such that u↵ ⌘ 0(mod m), then un ⌘ 0 (mod m) () ↵|n.

• v2p�2 ⌘ 0 (mod N) =) u2p�2 6⌘ 0 (mod N)

• u2n = unvn =) u2p�1 ⌘ 0 (mod N) =) ↵(N) = 2p�1

Page 13: people.math.sc.edu...Mersenne Primes The Lucas-Lehmer Test. Let p be an odd prime, and define recursively L 0 =4 and L n+1 = L 2 n 2 (mod (2 p 1)) for n 0. Then 2p 1 is a prime if

Suppose n ⌘ 7 (mod 4) isprime. We can take P = 4.

v1 = 4, v2 = 14, . . . v2n+1 = v22n � 2 (n � 0)

• (2±p

3)2�1 = ±p

12 (2±p

3) (all signs the same)

• vn = un+1 � un�1 and um+n = umun+1 � um�1un

• If pe|un with e � 1, then

ukn ⌘ kuk�1n+1un (mod pe+1) and ukn+1 ⌘ uk

n+1 (mod pe+1).

u(k+1)n = uknun+1 � ukn�1un = uknun+1 + un(ukn+1 � 4ukn)

• If pe|un with e � 1, then pe+1|upn.

• 8 primes p, 9 " = "p 2 {�1, 0, 1} such that p|up+".

u0 = 0, u1 = 1, u2 = 4, u3 = 15, . . . ("2 = "3 = 0)

un =

bn�12 cX

k=0

✓n

2k + 1

◆2n�2k�13k, vn =

bn/2cX

k=0

✓n

2k

◆2n�2k+13k

up ⌘ 3(p�1)/2 ⌘ ±1 (mod p) and vp ⌘ 4 (mod p)

sfds

• (2±p

3)2�1 = ±p

12 (2±p

3) (all signs the same)

• vn = un+1 � un�1 and um+n = umun+1 � um�1un

• If pe|un with e � 1, then

ukn ⌘ kuk�1n+1un (mod pe+1) and ukn+1 ⌘ uk

n+1 (mod pe+1).

u(k+1)n = uknun+1 � ukn�1un = uknun+1 + un(ukn+1 � 4ukn)

• If pe|un with e � 1, then pe+1|upn.

• 8 primes p, 9 " = "p 2 {�1, 0, 1} such that p|up+".

u0 = 0, u1 = 1, u2 = 4, u3 = 15, . . . ("2 = "3 = 0)

un =

bn�12 cX

k=0

✓n

2k + 1

◆2n�2k�13k, vn =

bn/2cX

k=0

✓n

2k

◆2n�2k+13k

up ⌘ 3(p�1)/2 ⌘ ±1 (mod p) and vp ⌘ 4 (mod p)

sfds

• gcd(un, un+1) = 1 and gcd(un, vn) 2

• For m 2 Z+, if ↵ = ↵(m) is minimal such that u↵ ⌘ 0(mod m), then un ⌘ 0 (mod m) () ↵|n.

Suppose n ⌘ 7 (mod 4) isprime. We can take P = 4.

v1 = 4, v2 = 14, . . . v2n+1 = v22n � 2 (n � 0)

Ln = v2n

N = 2p � 1 is a prime () v(N+1)/4 is divisible by N• gcd(un, un+1) = 1 and gcd(un, vn) 2

• For m 2 Z+, if ↵ = ↵(m) is minimal such that u↵ ⌘ 0(mod m), then un ⌘ 0 (mod m) () ↵|n.

• v2p�2 ⌘ 0 (mod N) =) u2p�2 6⌘ 0 (mod N)

• u2n = unvn =) u2p�1 ⌘ 0 (mod N) =) ↵(N) = 2p�1

• gcd(un, un+1) = 1 and gcd(un, vn) 2

• For m 2 Z+, if ↵ = ↵(m) is minimal such that u↵ ⌘ 0(mod m), then un ⌘ 0 (mod m) () ↵|n.

• v2p�2 ⌘ 0 (mod N) =) u2p�2 6⌘ 0 (mod N)

• u2n = unvn =) u2p�1 ⌘ 0 (mod N) =) ↵(N) = 2p�1

Write N = pe11 pe2

2 · · · perr with pj distinct primes and ej � 1.

Set "j = "pj and k = lcm�p

ej�1j (pj + ✏j) : j = 1, . . . , r

.

Then uk ⌘ 0 (mod N). Thus, ↵(2p � 1) = 2p�1 divides k.

Hence, 2p�1 divides pej�1j (pj + ✏j) for some j. For such j,

pj � 2p�1 � 1. Then 3pj > 2p � 1, implying N is prime.

• gcd(un, un+1) = 1 and gcd(un, vn) 2

• For m 2 Z+, if ↵ = ↵(m) is minimal such that u↵ ⌘ 0

(mod m), then un ⌘ 0 (mod m) () ↵|n.

• v2p�2 ⌘ 0 (mod N) =) u2p�2 6⌘ 0 (mod N)

• u2n = unvn =) u2p�1 ⌘ 0 (mod N) =) ↵(N) = 2p�1

Write N = pe11 pe2

2 · · · perr with pj distinct primes and ej � 1.

Set "j = "pj and k = lcm�p

ej�1j (pj + ✏j) : j = 1, . . . , r

.

Then uk ⌘ 0 (mod N). Thus, ↵(2p � 1) = 2p�1 divides k.

Hence, 2p�1 divides pej�1j (pj + ✏j) for some j. For such j,

pj � 2p�1 � 1. Then 3pj > 2p � 1, implying N is prime.

• gcd(un, un+1) = 1 and gcd(un, vn) 2

• For m 2 Z+, if ↵ = ↵(m) is minimal such that u↵ ⌘ 0

(mod m), then un ⌘ 0 (mod m) () ↵|n.

• v2p�2 ⌘ 0 (mod N) =) u2p�2 6⌘ 0 (mod N)

• u2n = unvn =) u2p�1 ⌘ 0 (mod N) =) ↵(N) = 2p�1

Write N = pe11 pe2

2 · · · perr with pj distinct primes and ej � 1.

Set "j = "pj and k = lcm�p

ej�1j (pj + ✏j) : j = 1, . . . , r

.

Then uk ⌘ 0 (mod N). Thus, ↵(2p � 1) = 2p�1 divides k.

Hence, 2p�1 divides pej�1j (pj + ✏j) for some j. For such j,

pj � 2p�1 � 1. Then 3pj > 2p � 1, implying N is prime.

• gcd(un, un+1) = 1 and gcd(un, vn) 2

• For m 2 Z+, if ↵ = ↵(m) is minimal such that u↵ ⌘ 0

(mod m), then un ⌘ 0 (mod m) () ↵|n.

• v2p�2 ⌘ 0 (mod N) =) u2p�2 6⌘ 0 (mod N)

• u2n = unvn =) u2p�1 ⌘ 0 (mod N) =) ↵(N) = 2p�1

Write N = pe11 pe2

2 · · · perr with pj distinct primes and ej � 1.

Set "j = "pj and k = lcm�p

ej�1j (pj + ✏j) : j = 1, . . . , r

.

Then uk ⌘ 0 (mod N). Thus, ↵(2p � 1) = 2p�1 divides k.

Hence, 2p�1 divides pej�1j (pj + ✏j) for some j. For such j,

pj � 2p�1 � 1. Then 3pj > 2p � 1, implying N is prime.

• gcd(un, un+1) = 1 and gcd(un, vn) 2

• For m 2 Z+, if ↵ = ↵(m) is minimal such that u↵ ⌘ 0

(mod m), then un ⌘ 0 (mod m) () ↵|n.

• v2p�2 ⌘ 0 (mod N) =) u2p�2 6⌘ 0 (mod N)

• u2n = unvn =) u2p�1 ⌘ 0 (mod N) =) ↵(N) = 2p�1

Write N = pe11 pe2

2 · · · perr with pj distinct primes and ej � 1.

Set "j = "pj and k = lcm�p

ej�1j (pj + ✏j) : j = 1, . . . , r

.

Then uk ⌘ 0 (mod N). Thus, ↵(2p � 1) = 2p�1 divides k.

Hence, 2p�1 divides pej�1j (pj + ✏j) for some j. For such j,

pj � 2p�1 � 1. Then 3pj > 2p � 1, implying N is prime.

• gcd(un, un+1) = 1 and gcd(un, vn) 2

• For m 2 Z+, if ↵ = ↵(m) is minimal such that u↵ ⌘ 0

(mod m), then un ⌘ 0 (mod m) () ↵|n.

• v2p�2 ⌘ 0 (mod N) =) u2p�2 6⌘ 0 (mod N)

• u2n = unvn =) u2p�1 ⌘ 0 (mod N) =) ↵(N) = 2p�1

Write N = pe11 pe2

2 · · · perr with pj distinct primes and ej � 1.

Set "j = "pj and k = lcm�p

ej�1j (pj + ✏j) : j = 1, . . . , r

.

Then uk ⌘ 0 (mod N). Thus, ↵(2p � 1) = 2p�1 divides k.

Hence, 2p�1 divides pej�1j (pj + ✏j) for some j. For such j,

pj � 2p�1 � 1. Then 3pj > 2p � 1, implying N is prime.

• gcd(un, un+1) = 1 and gcd(un, vn) 2

• For m 2 Z+, if ↵ = ↵(m) is minimal such that u↵ ⌘ 0

(mod m), then un ⌘ 0 (mod m) () ↵|n.

• v2p�2 ⌘ 0 (mod N) =) u2p�2 6⌘ 0 (mod N)

• u2n = unvn =) u2p�1 ⌘ 0 (mod N) =) ↵(N) = 2p�1

Write N = pe11 pe2

2 · · · perr with pj distinct primes and ej � 1.

Set "j = "pj and k = lcm�p

ej�1j (pj + ✏j) : j = 1, . . . , r

.

Then uk ⌘ 0 (mod N). Thus, ↵(2p � 1) = 2p�1 divides k.

Hence, 2p�1 divides pej�1j (pj + ✏j) for some j. For such j,

pj � 2p�1 � 1. Then 3pj > 2p � 1, implying N is prime.

• gcd(un, un+1) = 1 and gcd(un, vn) 2

• For m 2 Z+, if ↵ = ↵(m) is minimal such that u↵ ⌘ 0

(mod m), then un ⌘ 0 (mod m) () ↵|n.

• v2p�2 ⌘ 0 (mod N) =) u2p�2 6⌘ 0 (mod N)

• u2n = unvn =) u2p�1 ⌘ 0 (mod N) =) ↵(N) = 2p�1

Write N = pe11 pe2

2 · · · perr with pj distinct primes and ej � 1.

Set "j = "pj and k = lcm�p

ej�1j (pj + ✏j) : j = 1, . . . , r

.

Then uk ⌘ 0 (mod N). Thus, ↵(2p � 1) = 2p�1 divides k.

Hence, 2p�1 divides pej�1j (pj + ✏j) for some j. For such j,

pj � 2p�1 � 1. Then 3pj > 2p � 1, implying N is prime.

Page 14: people.math.sc.edu...Mersenne Primes The Lucas-Lehmer Test. Let p be an odd prime, and define recursively L 0 =4 and L n+1 = L 2 n 2 (mod (2 p 1)) for n 0. Then 2p 1 is a prime if

Other Primality Tests

Theorem (Selfridge-Weinberger). Assume that the Extended

Riemann Hypothesis holds. Let n be an odd integer > 1. A

necessary and su�cient condition for n to be prime is that

for all positive integers a < min{70(log n)2, n}, we have

a(n�1)/2 ⌘ ±1 (mod n) with at least one occurrence of �1.

Note: Primes pass this test but 1729 does not.

Theorem (Lucas). Let n be a positive integer. If there is

an integer a such that an�1 ⌘ 1 (mod n) and for all primes

p dividing n � 1 we have a(n�1)/p 6⌘ 1 (mod n), then n is

prime.

Revised Theorem. Let n be a positive integer. Suppose that

for each prime p dividing n � 1, there is an a 2 Z such

that an�1 ⌘ 1 (mod n) and a(n�1)/p 6⌘ 1 (mod n). Then nis prime.

Note: Primes pass this test but 1729 does not.

Idea: If pek(n � 1), then pe|ordna =) pe|�(n) =) n prime.

Other Primality Tests

Theorem (Selfridge-Weinberger). Assume that the Extended

Riemann Hypothesis holds. Let n be an odd integer > 1. A

necessary and su�cient condition for n to be prime is that

for all positive integers a < min{70(log n)2, n}, we have

a(n�1)/2 ⌘ ±1 (mod n) with at least one occurrence of �1.

Note: Primes pass this test but 1729 does not.

Theorem (Lucas). Let n be a positive integer. If there is

an integer a such that an�1 ⌘ 1 (mod n) and for all primes

p dividing n � 1 we have a(n�1)/p 6⌘ 1 (mod n), then n is

prime.

Revised Theorem. Let n be a positive integer. Suppose that

for each prime p dividing n � 1, there is an a 2 Z such

that an�1 ⌘ 1 (mod n) and a(n�1)/p 6⌘ 1 (mod n). Then nis prime.

Note: Primes pass this test but 1729 does not.

Idea: If pek(n � 1), then pe|ordna =) pe|�(n) =) n prime.

Other Primality Tests

Theorem (Selfridge-Weinberger). Assume that the Extended

Riemann Hypothesis holds. Let n be an odd integer > 1. A

necessary and su�cient condition for n to be prime is that

for all positive integers a < min{70(log n)2, n}, we have

a(n�1)/2 ⌘ ±1 (mod n) with at least one occurrence of �1.

Note: Primes pass this test but 1729 does not.

Theorem (Lucas). Let n be a positive integer. If there is

an integer a such that an�1 ⌘ 1 (mod n) and for all primes

p dividing n � 1 we have a(n�1)/p 6⌘ 1 (mod n), then n is

prime.

Revised Theorem. Let n be a positive integer. Suppose that

for each prime p dividing n � 1, there is an a 2 Z such

that an�1 ⌘ 1 (mod n) and a(n�1)/p 6⌘ 1 (mod n). Then nis prime.

Note: Primes pass this test but 1729 does not.

Idea: If pek(n � 1), then pe|ordna =) pe|�(n) =) n prime.

Other Primality Tests

Theorem (Selfridge-Weinberger). Assume that the Extended

Riemann Hypothesis holds. Let n be an odd integer > 1. A

necessary and su�cient condition for n to be prime is that

for all positive integers a < min{70(log n)2, n}, we have

a(n�1)/2 ⌘ ±1 (mod n) with at least one occurrence of �1.

Note: Primes pass this test but 1729 does not.

Theorem (Lucas). Let n be a positive integer. If there is

an integer a such that an�1 ⌘ 1 (mod n) and for all primes

p dividing n � 1 we have a(n�1)/p 6⌘ 1 (mod n), then n is

prime.

Revised Theorem. Let n be a positive integer. Suppose that

for each prime p dividing n � 1, there is an a 2 Z such

that an�1 ⌘ 1 (mod n) and a(n�1)/p 6⌘ 1 (mod n). Then nis prime.

Note: Primes pass this test but 1729 does not.

Idea: If pek(n � 1), then pe|ordna =) pe|�(n) =) n prime.

Page 15: people.math.sc.edu...Mersenne Primes The Lucas-Lehmer Test. Let p be an odd prime, and define recursively L 0 =4 and L n+1 = L 2 n 2 (mod (2 p 1)) for n 0. Then 2p 1 is a prime if

Other Primality Tests

Theorem (Selfridge-Weinberger). Assume that the Extended

Riemann Hypothesis holds. Let n be an odd integer > 1. A

necessary and su�cient condition for n to be prime is that

for all positive integers a < min{70(log n)2, n}, we have

a(n�1)/2 ⌘ ±1 (mod n) with at least one occurrence of �1.

Note: Primes pass this test but 1729 does not.

Theorem (Lucas). Let n be a positive integer. If there is

an integer a such that an�1 ⌘ 1 (mod n) and for all primes

p dividing n � 1 we have a(n�1)/p 6⌘ 1 (mod n), then n is

prime.

Revised Theorem. Let n be a positive integer. Suppose that

for each prime p dividing n � 1, there is an a 2 Z such

that an�1 ⌘ 1 (mod n) and a(n�1)/p 6⌘ 1 (mod n). Then nis prime.

Note: Primes pass this test but 1729 does not.

Idea: If pek(n � 1), then pe|ordna =) pe|�(n) =) n prime.

Other Primality Tests

Theorem (Selfridge-Weinberger). Assume that the Extended

Riemann Hypothesis holds. Let n be an odd integer > 1. A

necessary and su�cient condition for n to be prime is that

for all positive integers a < min{70(log n)2, n}, we have

a(n�1)/2 ⌘ ±1 (mod n) with at least one occurrence of �1.

Note: Primes pass this test but 1729 does not.

Theorem (Lucas). Let n be a positive integer. If there is

an integer a such that an�1 ⌘ 1 (mod n) and for all primes

p dividing n � 1 we have a(n�1)/p 6⌘ 1 (mod n), then n is

prime.

Revised Theorem. Let n be a positive integer. Suppose that

for each prime p dividing n � 1, there is an a 2 Z such

that an�1 ⌘ 1 (mod n) and a(n�1)/p 6⌘ 1 (mod n). Then nis prime.

Note: Primes pass this test but 1729 does not.

Idea: If pek(n � 1), then pe|ordna =) pe|�(n) =) n prime.

Other Primality Tests

Theorem (Selfridge-Weinberger). Assume that the Extended

Riemann Hypothesis holds. Let n be an odd integer > 1. A

necessary and su�cient condition for n to be prime is that

for all positive integers a < min{70(log n)2, n}, we have

a(n�1)/2 ⌘ ±1 (mod n) with at least one occurrence of �1.

Note: Primes pass this test but 1729 does not.

Theorem (Lucas). Let n be a positive integer. If there is

an integer a such that an�1 ⌘ 1 (mod n) and for all primes

p dividing n � 1 we have a(n�1)/p 6⌘ 1 (mod n), then n is

prime.

Revised Theorem. Let n be a positive integer. Suppose that

for each prime p dividing n � 1, there is an a 2 Z such

that an�1 ⌘ 1 (mod n) and a(n�1)/p 6⌘ 1 (mod n). Then nis prime.

Note: Primes pass this test but 1729 does not.

Idea: If pek(n � 1), then pe|ordna =) pe|�(n) =) n prime.

Other Primality Tests

Theorem (Selfridge-Weinberger). Assume that the Extended

Riemann Hypothesis holds. Let n be an odd integer > 1. A

necessary and su�cient condition for n to be prime is that

for all positive integers a < min{70(log n)2, n}, we have

a(n�1)/2 ⌘ ±1 (mod n) with at least one occurrence of �1.

Note: Primes pass this test but 1729 does not.

Theorem (Lucas). Let n be a positive integer. If there is

an integer a such that an�1 ⌘ 1 (mod n) and for all primes

p dividing n � 1 we have a(n�1)/p 6⌘ 1 (mod n), then n is

prime.

Revised Theorem. Let n be a positive integer. Suppose that

for each prime p dividing n � 1, there is an a 2 Z such

that an�1 ⌘ 1 (mod n) and a(n�1)/p 6⌘ 1 (mod n). Then nis prime.

Note: Primes pass this test but 1729 does not.

Idea: If pek(n � 1), then pe|ordna =) pe|�(n) =) n prime.

This test is good if and only if one can factor n � 1.