because (p−1)/2 is odd. This contradicts Fermat's theorem, so x2≡−1(modp) has no solution.
If the primes congruent to 1(mod4) were p1,…,pk, set N=(2p1⋯pk)2+1. Any prime divisor q of N is odd and has −1asa quadratic residue. The preceding result forces q≡1(mod4), but q divides none of the pi because N≡1(modpi). This contradiction proves that infinitely many primes are congruent to 1(mod4).