PlanetMath (more info)
 Math for the people, by the people. Sponsor PlanetMath
Encyclopedia | Requests | Forums | Docs | Wiki | Random | RSS  
Login
create new user
name:
pass:
forget your password?
Main Menu
Owner confidence rating: High Entry average rating: Very high
[parent] proof of Lucas-Lehmer primality test (Proof)

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}\equiv 0\pod {M_p}$ ) where the numbers $(s_n)_{n\geq1}$ are given by the following recurrence relation:

$\displaystyle s_1$ $\displaystyle = 4$    
$\displaystyle s_{n+1}$ $\displaystyle = {s_n}^2-2,\quad n\geq 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 $\alpha^{(M_p+1)/2}\equiv -1\pod{M_p}$ , where $\alpha = 2+\sqrt{3}$ .

To see that the two are in fact equivalent, let $\beta=2-\sqrt{3}$ . Then $\alpha+\beta=4,\ \alpha\beta=1$ . Thus

$\displaystyle s_1$ $\displaystyle = \alpha+\beta$    
$\displaystyle s_2$ $\displaystyle = (\alpha+\beta)^2 - 2 = \alpha^2 + \beta^2 + 2\alpha\beta-2 = \alpha^2+\beta^2$    
$\displaystyle s_3$ $\displaystyle = \alpha^4 + \beta^4$    
$\displaystyle \cdots$    
$\displaystyle s_{p-1}$ $\displaystyle = \alpha^{2^{p-2}}+\beta^{2^{p-2}}$    

Note that $2^{p-2} = \frac{M_p+1}{4}$ . Then
$\displaystyle s_{p-1}\equiv 0\pod{M_p}$ $\displaystyle \iff \alpha^{(M_p+1)/4}+\beta^{(M_p+1)/4} \equiv 0\pod {M_p}$    
  $\displaystyle \iff \alpha^{(M_p+1)/2}+(\alpha\beta)^{(M_p+1)/4} \equiv 0\pod {M_p}$    
  $\displaystyle \iff \alpha^{(M_p+1)/2}\equiv -1\pod {M_p}$    

It thus remains to prove Theorem 1. We start with two simple lemmas:
Lemma 2   If $p>3$ is prime, then $\alpha^{p-1}\equiv 1\pod p$ or $\alpha^{p+1}\equiv 1\pod p$ .
Proof.

$\displaystyle \alpha^p \equiv 2^p + 3^{(p-1)/2}\sqrt{3} \equiv \begin{cases}\al... ...p}\right)=1\ \beta \pod p & \text{if }\left(\frac{3}{p}\right)=-1\end{cases} $
where $\Leg{\cdot}{\cdot}$ is the Legendre symbol. Thus
$\displaystyle \left(\frac{3}{p}\right) = 1 \ \Rightarrow\ \alpha^{p-1} = \alpha^p\alpha^{-1} = \alpha^p\beta \equiv \alpha\beta = 1\pod p$    
$\displaystyle \left(\frac{3}{p}\right) = -1 \ \Rightarrow\ \alpha^{p+1} = \alpha^p\alpha \equiv \beta\alpha = 1\pod p$    

$ \qedsymbol$
Lemma 3   Let $p$ be a prime with $p\equiv 7\pod 8$ and $p\equiv 7\pod {12}$ . Then $\alpha^{(p+1)/2}\equiv -1\pod p$ .
Proof. $(1+\sqrt{3})^2 = 4+2\sqrt{3} = 2\alpha$ , so that $$ (1+\sqrt{3})^{p+1} = 2^{(p+1)/2}\alpha^{(p+1)/2} $$ But $p\equiv 7\pod 8$ , so that $\Leg{2}{p}=1$ . Thus $2^{(p+1)/2} \equiv 2\cdot 2^{(p-1)/2} \equiv 2 \pod p$ and therefore $$ (1+\sqrt{3})^{p+1} \equiv 2\alpha^{(p+1)/2}\pod p $$ Also, $$ (1+\sqrt{3})^{p+1} = (1+\sqrt{3})(1+\sqrt{3})^p \equiv (1+\sqrt{3})(1+3^{(p-1)/2}\sqrt{3})\pod p $$ But $p\equiv 7\pod {12}$ , so $3^{(p-1)/2}\equiv -1\pod p$ and thus $$ (1+\sqrt{3})^{p+1} \equiv (1+\sqrt{3})(1-\sqrt{3}) = -2\pod p $$ Putting together the two expressions for $(1+\sqrt{3})^{p+1}$ , we get $\alpha^{(p+1)/2}\equiv -1\pod p$ . $ \qedsymbol$

We are now in a position to prove Theorem 1:

Proof. $(\Rightarrow):$ If $M_p$ is prime where $p>3$ is prime, then note that $M_p\equiv 7\pod 8, 7\pod 12$ so that $M_p$ satisfies the conditions of Lemma 3. The result follows.

$(\Leftarrow):$ If $\alpha^{(M_p+1)/2} \equiv -1\pod{M_p}$ , choose $q\mid M_p$ for $q$ a prime. Since $M_p\equiv 7\pod 12$ , we have $q>3$ . Since $\alpha^{(M_p+1)/2}\equiv -1\pod{M_p}$ also $\alpha^{(M_p+1)/2}\equiv -1\pod q$ and thus $\alpha^{M_p+1}\equiv 1\pod q$ . But $M_p+1=2^p$ , so $$ \alpha^{2^p} \equiv 1\pod q $$ Thus the order of $\alpha\pod q$ divides $2^n$ . It can't divide $2^{n-1}$ since $\alpha^{(M_p+1)/2} \equiv -1\pod q$ , so its order is precisely $2^n = M_p+1$ . However, $\alpha^{q+1}\equiv 1\pod q$ or $\alpha^{q-1}\equiv 1\pod q$ by Lemma 2 and thus $q\geq M_p$ . But $q\mid M_p$ , so $q=M_p$ and $M_p$ is in fact prime. $ \qedsymbol$




"proof of Lucas-Lehmer primality test" is owned by rm50.
(view preamble | get metadata)

View style:


This object's parent.
Log in to rate this entry.
(view current ratings)

Cross-references: order, expressions, Legendre symbol, simple, theorem, equivalent, primality, recurrence relation, numbers, divides, Mersenne number, prime, Lucas-Lehmer primality test

This is version 2 of proof of Lucas-Lehmer primality test, born on 2009-01-05, modified 2009-01-06.
Object id is 11468, canonical name is ProofOfLucasLehmerPrimalityTest.
Accessed 392 times total.

Classification:
AMS MSC11A51 (Number theory :: Elementary number theory :: Factorization; primality)

Pending Errata and Addenda
None.
Discussion
Style: Expand: Order:
forum policy

No messages.

Interact
post | correct | update request | add example | add (any)