This is a generalization of this claim .
Can you provide a proof or a counterexample for the following claim?
Let $n$ be a natural number greater than two . Let $L_n^{(a)}(x)=2^{-n}\cdot\left(\left(x-\sqrt{x^2+4a}\right)^n+\left(x+\sqrt{x^2+4a}\right)^n\right)$ , where $a$ is an integer coprime to $n$ . Then $n$ is a prime number if and only if $\displaystyle\sum_{k=0}^{n-1}L_{n-1}^{(a)}(k) \equiv -1 \pmod {n}$ .
You can run this test here .
I have tested this claim for many random values of $n$ and $a$ and there were no counterexamples .