Can someone provide counterexample, if one exists, to 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= 2 \cdot 6^{n}-1 $ where $n\ge3$ . Let $S_i=S_{i-1}^6-6S_{i-1}^4+9S_{i-1}^2-2$ with $S_0=P_{18}(5)$ . Then, if $S_{n-2} \equiv 0 \pmod{N}$ then $N$ is prime .
You can run this test here.
Note that $P_m(x)=2T_m \left(\frac{x}{2}\right)$, where $T_m(x)$ is mth Chebyshev polynomial of the first kind. Also , note that $S_i=P_6(S_{i-1})$ .
I was searching for counterexample using the following PARI/GP code:
CE261(n1,n2)=
{
for(n=n1,n2,
N=2*6^n-1;
S=2*polchebyshev(18,1,5/2);
ctr=1;
while(ctr<=n-2,
S=Mod(2*polchebyshev(6,1,S/2),N);
ctr+=1);
if(S==0 && !ispseudoprime(N),print("n="n)))
}
I have tested this claim for all $n$ up to $10000$ and there were no counterexamples.
Python script that implements this test can be found here.
EDIT
An Android app that implements this test can be found here.