Questions tagged [lucas-lehmer-test]

The Lucas–Lehmer test (LLT) is a primality test for Mersenne numbers.

The Lucas–Lehmer test works as follows. Let $M_p = 2^p − 1$ be the Mersenne number to test with $p$ an odd prime. The primality of $p$ can be efficiently checked with a simple algorithm like trial division since $p$ is exponentially smaller than $M_p$. Define a sequence $ \{ s _ i \} $ for all $ i \ge 0 $ by

$$ s _ i = \begin{cases} 4 & \text{if } i = 0 \text ; \\\\ s _ { i - 1 } ^ 2 - 2 & \text{otherwise.} \end{cases} $$

The first few terms of this sequence are $4$, $14$, $194$, $37634$, $\dots$. Then $M_p$ is prime if and only if

$$ s _ { p - 2 } \equiv 0 \pmod { M _ p } \text . $$

The number $ s _ { p - 2 } mod M _ p $ is called the Lucas–Lehmer residue of $p$. (Some authors equivalently set $ s _ 1 = 4 $ and test $ s _ { p - 1 } \mod M _ p $).

Starting values $ s _ 0 $ other than $ 4 $ are possible, for instance $ 10 $, $ 52 $, and others. The Lucas-Lehmer residue calculated with these alternative starting values will still be zero if $ M _ p $ is a Mersenne prime. However, the terms of the sequence will be different and a non-zero Lucas-Lehmer residue for non-prime $ M _ p $ will have a different numerical value from the non-zero value calculated when $ s _ 0 = 4 $.

It is also possible to use the starting value $ ( 2 \mod M _ p ) ( 3 \mod M _ p ) ^ { - 1 } $, usually denoted by $ \frac 2 3 $ for short. This starting value equals $ \frac { 2 ^ p + 1 } 3 $, the Wagstaff number with exponent $ p $.

Starting values like $ 4 $, $ 10 $, and $ \frac 2 3 $ are universal, that is, they are valid for all (or nearly all) $ p $. There are infinitely many additional universal starting values. However, some other starting values are only valid for a subset of all possible $ p $, for example $ s _ 0 = 3 $ can be used if $ p = 3 \pmod 4 $. This starting value was often used where suitable in the era of hand computation, including by Lucas in proving $ M _ { 127 } $ prime. The first few terms of the sequence are $ 3 $, $ 7 $, $ 47 $, $ \dots $.

Source: Wikipedia

20 questions
10
votes
4 answers

Primality test for numbers of the form $(11^p-1)/10$

This question is the successor of Primality test for numbers of the form (3^p−1)/2 Here is what I observed: Let $N$ = $(11^p-1)/10$ when $p$ is a prime number $p > 3$. Let the sequence $S_i=S_{i-1}^{11}-11 S_{i-1}^9+44 S_{i-1}^7-77 S_{i-1}^5+55…
8
votes
1 answer

Primality test for numbers of the form $N=k \cdot 3^n-1$

Can you provide proof or counterexample for the claim given below? Inspired by Lucas-Lehmer-Riesel primality test I have formulated the following claim: Let $P_m(x)=2^{-m}\cdot((x-\sqrt{x^2-4})^m+(x+\sqrt{x^2-4})^m)$ . Let $N= k \cdot 3^{n}-1 $…
5
votes
1 answer

Primality test for numbers of the form $N=4 \cdot 3^n-1$

Can you provide proof or counterexample for the claim given below? Inspired by Lucas-Lehmer primality test I have formulated the following claim: Let $P_m(x)=2^{-m}\cdot((x-\sqrt{x^2-4})^m+(x+\sqrt{x^2-4})^m)$ . Let $N= 4 \cdot 3^{n}-1 $ where…
5
votes
1 answer

Conjectured primality tests for specific classes of $k\cdot b^n \pm 1$

Can you provide proofs or counterexamples for the claims given below? Inspired by Lucas-Lehmer-Riesel primality test I have formulated the following two claims: First claim Let $P_m(x)=2^{-m}\cdot((x-\sqrt{x^2-4})^m+(x+\sqrt{x^2-4})^m)$ . Let…
4
votes
1 answer

Primality test for numbers of the form $N=4 \cdot 3^n+1$

Can you provide proof or counterexample for the claim given below? Inspired by Lucas-Lehmer primality test I have formulated the following claim: Let $P_m(x)=2^{-m}\cdot((x-\sqrt{x^2-4})^m+(x+\sqrt{x^2-4})^m)$ . Let $N= 4 \cdot 3^{n}+1 $ where…
3
votes
0 answers

if such counter example to Lehmer's totient problem exists then could we have more counter examples?

Lehmer's totient problem asks whether there is any composite number $n$ such that Euler's totient function $φ(n)$ divides $n − 1$. which it is unsolved problem or we may reformulate that question as : if $φ(n)$ divides $n − 1$ then $n$ must be a…
2
votes
0 answers

An explanation of why the Lucas-Lehmer Primality Test works: is this OK?

I've always wondered why the Lucas-Lehmer Primality Test works. After studying it, I came up with an explanation. I hope you can help me confirm and complete it. A Mersenne prime is a number of the form Mp = 2p – 1, when Mp and p are primes. The…
2
votes
1 answer

Lucas-Lehmer test for Mersenne and Wagstaff numbers?

Here is what I observed : Let $M_p = 2^p-1$ for Mersenne numbers and $W_p = (2^p+1)/3$ for Wagstaff numbers with $p$ a prime number > $2$ Let the sequence $S_i = 6 \cdot S_{i-1}^2 + 18 \cdot S_{i-1} +12$ with $S_0 = 12$ Then $M_p$ or $W_p$ is prime…
2
votes
1 answer

Lucas Lehmer Test

I have tried to write a function that test if it is prime using Lucas Lehmer Test function y=ex2(p) s=4; for i=3:p s=s.^2-2; end if (mod(s,2.^p-1)==0) y=1; else y=0; end end but it does not work
2
votes
2 answers

What area's of mathematics are needed to make a basic understanding of the FFT algorithm ?

I know FFT is used in signal processing ( at last check), the Lucas-Lehmer Test and probably many other things. But what is the Fast Fourier Transform and what area's of math will help me understand transforms like it ( and yes I know of the area…
1
vote
0 answers

Is it possible to explain why the Lucas-Lehmer primality test works to someone who is not a math professional?

I know the proof of the Lucas-Lehmer test is based on group theory. My math knowledge is not deep and that is why I don't understand why the test is working. Is it possible to explain to someone who is not familiar with group theory why the test…
1
vote
1 answer

Primality test for numbers of the form $(10^p-1)/9$ (and maybe $((10 \cdot 2^n)^p-1)/(10 \cdot 2^n-1)$)

This question is successor of Primality test for numbers of the form (11^p−1)/10 Here is what I observed: For $(10^p-1)/9$ : Let $N$ = $(10^p-1)/9$ when $p$ is a prime number $p > 3$. Let the sequence $S_i=S_{i-1}^{10}-10 S_{i-1}^8+35 S_{i-1}^6-50…
1
vote
1 answer

Primality test for Mersenne numbers using the fourth Chebyshev polynomial of the first kind

Can you provide a proof or a counterexample for the claim given below? Inspired by Lucas-Lehmer test I have formulated the following claim : Let $T_n(x)$ be the nth Chebyshev polynomial of the first kind. Let $M_p=2^p-1$ such that $p$ is an odd…
1
vote
0 answers

Pell-Lucas number

I'm studying about Pell number and Pell-Lucas number whose have Binet formula $P_n=\frac{\alpha^n-\beta^n}{\alpha-\beta}$ and $Q_n=\alpha^n+\beta^n$, where $\alpha=1+\sqrt{2}$ and $\beta=1-\sqrt{2}$, respectively. The simple relation between two of…
1
vote
0 answers

What are some basic properties of the quotient $s_n\over M_p$ where $M_p$ is a Mersenne prime?

I've been exploring the Lucas-Lehmer test for a while now. I already know the square of one Mersenne $(2^n-1)^2$ is $(2^{n-1}-1)(2^{n+1}-1)+2^{n-1}$. Today I'm looking to use the properties of the other divisor of $s_{n-2}$, such that I can start…
1
2