TITLE: Primality test for $N=4p+1$
QUESTION [6 upvotes]: Can you prove or disprove the following claim:

Let $N=4p+1$ where $p$ is an odd prime number , let $T_n(x)$ be the nth Chebyshev polynomial of the first kind and let $F_n(x)$ denote an irreducible factor of degree $\varphi(n)$ of $T_n(x)$ . If there exists an integer $a$ such that $F_{p}(a) \equiv 0 \pmod{N} $ then $N$ is a prime.

You can run this test here. An incomplete  list of primes $p$ such that $4p+1$ is prime can be found here . I have verified this claim for $p \in [3,30000)$ with $a \in [1,100]$ .

REPLY [8 votes]: The claim is true, and it holds more generally for every odd integer $p\geq 3$; the assumption that $p$ is prime is not needed. By the known factorization of Chebyshev polynomials,
$$F_p(x/2)=\prod_{\substack{1\leq m\leq 2p-1\\(m,4p)=1}}(x-\zeta^m-\zeta^{-m}),$$
where $\zeta\in\mathbb{C}$ is a primitive $4p$-th root of unity. The splitting field of $F_p(x/2)$ is the subfield of the $4p$-th cyclotomic field fixed by complex conjugation; it is of degree $\varphi(p)$.
Assume that $q\nmid 2p$ is a prime number such that the reduction of $F_p(x/2)$ mod $q$ has a root in $\mathbb{F}_q$. The roots of $F_p(x/2)$ in $\overline{\mathbb{F}_q}$ are of the form $\xi^m+\xi^{-m}$, where $\xi\in\overline{\mathbb{F}_q}$ is a primitive $4p$-th root of unity. By assumption, the Frobenius automorphism $t\mapsto t^q$ fixes one of these roots, which is only possible when $q\equiv\pm 1\pmod{4p}$. It follows that, for any $a\in\mathbb{Z}$, the prime factors of $F_p(a)$ coprime to $2p$ are congruent to $\pm 1$ modulo $4p$. In particular, if $4p+1$ divides $F_p(a)$, then the only prime factor of $4p+1$ can be itself, i.e., $4p+1$ is prime.