Primality test for numbers of the form $4p+1$

219 Views Asked by At

I am looking for the alternative proof of the claim given below .

Theorem 1

Suppose $n-1=FR$ , where $F>R$ , $\operatorname{gcd}(F,R)$ is one and the factorization of $F$ is known . If for every prime factor $q$ of $F$ there is an integer $a>1$ such that

  1. $a^{n-1} \equiv 1 \pmod n$ , and

  2. $\operatorname{gcd}(a^{(n-1)/q}-1,n) = 1$

then $n$ is prime .

Claim

Let $p\equiv 1 \pmod 6$ be prime and let $5 \not\mid 4p+1$ , then $4p+1$ is prime iff $4p+1 \mid 2^{2p}+1$ .

Proof

Necessity : let $n=4p+1$ . Assume that $n$ is prime . By Euler's criterion $2^{(n-1)/2} \equiv \left(\frac{2}{n}\right) \pmod n$ , where $\left(\frac{2}{n}\right)$ is the Legendre symbol . Since $p\equiv 1 \pmod 6$ it follows $n \equiv 5 \pmod 8$ and so $\left(\frac{2}{n}\right)=-1$ . Therefore $2^{2p} \equiv -1 \pmod {4p+1}$ .

Sufficiency : let $n=4p+1$ . Assume that the congruence $2^{(n-1)/2} \equiv -1 \pmod n$ holds . Then $2^{n-1} \equiv 1 \pmod n$ . On the other hand we have $\operatorname{gcd}(2^{(n-1)/p}-1,n) = \operatorname{gcd}(2^4-1,n)= 1$ , so $n$ is prime by theorem 1 .