# Compositeness test for numbers of the form $E_n(b)=\frac{b^{2^n}+1}{2}$

Can you provide a proof or a counterexample for the following claim?

Let $$P_m(x)=2^{-m}\cdot((x-\sqrt{x^2-4})^m+(x+\sqrt{x^2-4})^m)$$ . Let $$E_n(b)= \frac{b^{2^n}+1}{2}$$ where $$b$$ is an odd natural number greater than one and $$n\ge2$$ . Let $$a$$ be a natural number greater than two such that $$\left(\frac{a-2}{E_n(b)}\right)=-1$$ and $$\left(\frac{a+2}{E_n(b)}\right)=-1$$ where $$\left(\frac{}{}\right)$$ denotes Jacobi symbol. Let $$S_i=P_b(S_{i-1})$$ with $$S_0$$ equal to the modular $$P_{b^2}(a)\phantom{5} \text{mod} \phantom{5} E_n(b)$$. Then if $$E_n(b)$$ is prime then $$S_{2^n-2} \equiv a \pmod{E_n(b)}$$ .

You can run this test here.

I have tested this claim for many random values of $$b$$ and $$n$$ and there were no counterexamples.