Conjectured new primality test for Mersenne numbers

How to prove that this conjecture about a new primality test for Mersenne numbers is true ?

Definition: Let $M_{q}=2^{q}-1 , S_{0} = 3^{2} + 1/3^{2} , \ and: \ S_{i+1} = S_{i}^{2}-2 \pmod{M_{q}}$

Conjecture: $$M_{q}\text{ is a prime iff: } \ S_{q-1} \equiv S_{0} \pmod{M_{q}}$$ $$\text{ and iff: } \prod_{0}^{q-2} S_i \equiv 1 \pmod{M_{q}}$$ $$\text{ and iff: } S_i \not\equiv S_0 \pmod{M_{q}} , 0 < i < q-1$$

The easy part part (if $M_{q}$ is prime then $S_{q-1}\equiv S_{0} \pmod{M_{q}}$), has already been proven. See: http://tony.reix.free.fr/Mersenne/ConjectureLLTCyclesMersenne.pdf .

Now, a proof of the converse is needed.

The "classic" LLT by Lucas and Lehmer for Mersenne numbers is based on the binary tree of the digraph (under $x^2-2 \pmod{M_q}$). This new conjectured test makes use of a cycle of the same digraph.

The goal of this question is to validate (or not) the method (use a cycle of the digraph) for Wagstaff numbers ($\dfrac{2^q+1}{3}$ , q prime) for which we also lack a proof for the converse. See: https://trex58.files.wordpress.com/2009/01/wagstaffandfermat.pdf for a proof of the easy part, by Robert Gerbicz .

I and a team (Vincent and Paul) had found a very large Wagstaff PRP with this algorithm. See: http://www.primenumbers.net/prptop/prptop.php (2^4031399+1)/3 , rank 9 for now.

• Does not the criterion amount to the disjunction of $3^{2^{q-1}-1}\equiv\pm1$ and $3^{2^{q-1}+1}\equiv\pm1$ ($\mod{M_q}$)? – მამუკა ჯიბლაძე Sep 2 '15 at 5:20
• Hummmm I do not follow you. Would you mind elaborating ? Thanks. – Tony Reix Sep 3 '15 at 16:11
• Well to begin with, $S_i=9^{2^i}+9^{-2^i}$ ($\mod M_q$); so $S_{q-1}-S_0$ is $9^{2^{q-1}}+9^{-2^{q-1}}-9-9^{-1}$ which may be rewritten as$$9^{-2^{q-1}}\left(9^{2^q}-9^{2^{q-1}+1}-9^{2^{q-1}-1}+1\right).$$ This is zero mod $M_q$ (provided $M_q$ is not divisible by $3$) if and only if $9^{2^q}-9^{2^{q-1}+1}-9^{2^{q-1}-1}+1$ is. One may further decompose, it is$$\left(9^{2^{q-1}+1}-1\right)\left(9^{2^{q-1}-1}-1\right)=\left(3^{2^{q-1}+1}-1\right)\left(3^{2^{q-1}+1}+1\right)\left(3^{2^{q-1}-1}-1\right)\left(3^{2^{q-1}-1}+1\right).$$ – მამუკა ჯიბლაძე Sep 3 '15 at 16:29
• Oh yes. Much clearer now. Thanks. Do you think it can help proving the converse of the conjecture ? – Tony Reix Sep 3 '15 at 17:41
• Honestly I don't know. I just meant adding this version might be useful. In case of course if I am not mistaken and it is really equivalent. – მამუკა ჯიბლაძე Sep 3 '15 at 18:17