This question is related to my [previous question][1]. Can you prove or disprove the following claim: >Let $P_m(x)=2^{-m}\cdot \left(\left(x-\sqrt{x^2-4}\right)^{m}+\left(x+\sqrt{x^2-4}\right)^{m}\right)$ >Let $N=8k3^n-1$ such that $n>2$ , $k>0$ , $8k <3^n$ and >$\begin{cases} k \equiv 1 \pmod{5} \text{ with } n \equiv 0,1 \pmod{4} \\ k \equiv 2 \pmod{5} \text{ with } n \equiv 1,2 \pmod{4} \\ k \equiv 3 \pmod{5} \text{ with } n \equiv 0,3 \pmod{4} \\ k \equiv 4 \pmod{5} \text{ with } n \equiv 2,3 \pmod{4} \end{cases}$ >Let $S_i=S_{i-1}^3-3S_{i-1}$ with $S_0=P_{18k}(3)$ , then $N$ is prime iff $S_{n-2} \equiv 0 \pmod N$ . You can run this test [here][2]. I have verified this claim for $k \in [1,300]$ with $n \in [3,1000]$ . [1]: https://mathoverflow.net/q/361489/88804 [2]: https://sagecell.sagemath.org/?z=eJw1i7EOwiAURXf-wk6AEAUcmuCbnG1M2DtYMby0BUKJxr8XB8dzz7kzKBvhZMkAPZ-5GaNUljjQPKdlCv7-2YJ_UdWkUMIcNLNkqqW9yDvg4mmDM0SphYNrelA3Gmm4EwOzzexBtR6f1AEcRS4YK-1uBVe_69ifL2nNacP629gXhkEpsA==&lang=gp&interacts=eJyLjgUAARUAuQ==