In the Lucas–Lehmer test with $ \quad p \quad $ an odd prime.


we know that $ \quad S\_0=4 \quad $ and $ \quad S\_i=S\_{i-1}^2-2 \quad $ for $\quad i>0 \quad$


$M\_p=2^p-1 \quad$ is prime if $ \quad S\_{p-2} \equiv 0 \bmod {(2^p-1)}$


after some observations i found a link with Triangle of coefficients of Chebyshev's OEIS [A053122](https://oeis.org/A053122)


$a(n,k)=(-1)^{n-k}\left(\begin{matrix} n+1+k \\ 2 \cdot k+1 \end{matrix}\right)$


from which


$S\_{i+1} \cdot S\_{i+2}\cdot \quad \ldots \quad \cdot S\_{i+m} = \sum\limits\_{k=0}^{2^m-1}{(-1)^{k+1}\left(\begin{matrix} 2^m+k \\ 2 \cdot k+1 \end{matrix}\right) \cdot (S\_i^2)^k }$


can anyone help me find any reference or pointer on how to derive this result?



Lucas–Lehmer test and triangle of coefficients of Chebyshev's
By the [composition property](https://en.wikipedia.org/wiki/Chebyshev_polynomials#Composition_and_divisibility_properties) of Chebyshev polynomials $T\_m(T\_n(x))=T\_{mn}(x)$. Since $x^2-2 = 2T\_2(\tfrac{x}2)$, we have $S\_i = 2T\_{2^i}(2)$ for all $i\geq 0$.


Furthermore, since $T\_{2^k}(x) = \frac{U\_{2^{k+1}-1}(x)}{2U\_{2^{k}-1}(x)}$, we have
\begin{split} S\_{i+1}\cdot S\_{i+1}\cdots S\_{i+m} &= 2^m T\_{2^{i+1}}(2)\cdot T\_{2^{i+2}}(2)\cdots T\_{2^{i+m}}(2) \\
&=\frac{U\_{2^{m+i+1}-1}(2)}{U\_{2^{i+1}-1}(2)} \\
&= U\_{2^m-1}(T\_{2^{i+1}}(2))\\
&= \frac{U\_{2^{m+1}-1}(T\_{2^i}(2))}{2T\_{2^i}(2)}\\
&= \frac{U\_{2^{m+1}-1}(\tfrac{S\_i}2)}{S\_i}.
\end{split}
and it remains to use an [explicit expression](https://en.wikipedia.org/wiki/Chebyshev_polynomials#Explicit_expressions) for $U\_{2^{m+1}-1}(x)$ to obtain the formula in question.


