10.12.2012 Views

Prime Numbers

Prime Numbers

Prime Numbers

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

4.2 The n + 1 test 183<br />

f in (4.12) satisfies rf (n) =n +1 is 2(n +1)/ϕ(n + 1). If n>892271479, then<br />

this expected number of choices is less than 4 ln ln n; see Exercise 4.16.<br />

It is also possible to describe a primality test using the V sequence in<br />

(4.13).<br />

Theorem 4.2.5. Let f,∆ be as in (4.12) and let n be a positive integer with<br />

gcd(n, 2b) =1and <br />

∆<br />

n = −1. IfF is an even divisor of n +1 and<br />

V F/2 ≡ 0(modn), gcd(V F/2q,n)=1for every odd prime q|F, (4.15)<br />

then every prime p dividing n satisfies p ≡ <br />

∆<br />

p (mod F ). In particular, if<br />

F> √ n +1, then n is prime.<br />

Proof. Suppose p is an odd prime that divides both Um,Vm. Then (4.13)<br />

implies x m ≡ (a − x) m (mod (f(x),p)) and x m ≡−(a − x) m (mod f(x),p),<br />

so that x m ≡ 0(mod(f(x),p)). Then b m ≡ (x(a − x)) m ≡ 0(mod(f(x),p));<br />

that is, p divides b. Sincen is coprime to 2b, and since U2m = UmVm, wehave<br />

gcd(U2m,n)=gcd(Um,n) · gcd(Vm,n).<br />

Thus, the first condition in (4.15) implies UF ≡ 0(modn) and gcd(U F/2,n)=<br />

1. Now suppose q is an odd prime factor of F .WehaveU F/q = U F/2qV F/2q<br />

coprime to n. Indeed, U F/2q divides U F/2, sothatgcd(U F/2q,n) = 1, and so<br />

with the second condition in (4.15) we have that gcd(U F/q,n) = 1. Thus,<br />

rf (p) =F , and as in the proof of Theorem 4.2.3, this is sufficient for the<br />

conclusion. ✷<br />

Just as the n − 1 is particularly well suited for Fermat numbers, the n +1<br />

test is especially speedy for Mersenne numbers.<br />

Theorem 4.2.6 (Lucas–Lehmer test for Mersenne primes). Consider the<br />

sequence (vk) for k =0, 1,...,recursively defined by v0 =4and vk+1 = v 2 k −2.<br />

Let p be an odd prime. Then Mp =2 p − 1 is prime if and only if vp−2 ≡ 0<br />

(mod Mp).<br />

Proof. Let f(x) =x2 − 4x + 1, so that ∆ = 12. Since Mp ≡ 3(mod4)<br />

and Mp ≡ 1 (mod 3), we see that <br />

∆ = −1. We apply Theorem 4.2.5 with<br />

Mp<br />

F =2p−1 =(Mp +1)/2. The conditions (4.15) reduce to the single condition<br />

V2p−2 ≡ 0(modMp). But<br />

V2m ≡ x 2m +(4−x) 2m =(x m +(4−x) m ) 2 −2x m (4−x) m ≡ V 2 m−2 (modf(x)),<br />

since x(4 − x) ≡ 1(modf(x)); see (3.15). Also, V1 =4.Thus,V2k = vk, and<br />

it follows from Theorem 4.2.5 that if vp−2 ≡ 0(modMp), then Mp is prime.<br />

Suppose, conversely, that M = Mp is prime. Since <br />

∆<br />

M = −1,<br />

Z[x]/(f(x),M) is isomorphic to the finite field FM 2. Thus, raising to the M<br />

power is an automorphism and xM ≡ 4 − x (mod (f(x),M)); see the proof of<br />

Theorem 3.6.3. We compute (x − 1) M+1 two ways. First, since (x − 1) 2 ≡ 2x

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!