representing primes as x2+n⁢y2


Theorem 1 (Fermat).

An odd prime p can be written p=x2+y2 with x,y∈Z if and only if p≡1(mod4).

Proof.

⇒: This direction is obvious. Since p is odd, exactly one of x,y is odd. If (say) x is odd and y is even, then x2≡1(mod4) and y2≡0(mod4).
⇐: Since p≡1(mod4), by Euler’s Criterion we have that (-1p)=1 where (np) is the Legendre symbolMathworldPlanetmath. Choose k such that p∣k2+1. Working in ℤ⁢[i] we have k2+1=(k+i)⁢(k-i). Then p∣k2+1, but p does not divide either factor since p∤k. Hence p is not prime. Since ℤ⁢[i] is a UFD, it follows that p is not irreduciblePlanetmathPlanetmath either, so we can write p=(a+b⁢i)⁢(c+d⁢i), where neither factor is a unit (i.e. neither factor has norm 1). Taking norms, we get

p2=N⁢(p)=N⁢(a+b⁢i)⁢N⁢(c+d⁢i)=(a2+b2)⁢(c2+d2)

Since neither factor has norm 1, we must have p=a2+b2=c2+d2, so p is the sum of two squares. ∎

There are more elementary proofs of ⇐, but one can try to generalize the given proof for arbitrary n. When can p be written as x2+n⁢y2,n>0? By analogy with the proof for n=1, suppose we find k such that p∣k2+n (i.e. that (-np)=1). Then in ℤ⁢[-n], it follows that k2+n=(k+-n)⁢(k--n), so again p is not prime since it does not divide either factor. If ℤ⁢[-n] is a UFD, then p is not irreducible either. We can then write as before p=(a+b⁢-n)⁢(c+d⁢-n) and, taking norms, we get the same result: p=a2+n⁢b2=c2+n⁢d2.

This argumentPlanetmathPlanetmath relies on two things: first, that -n is a square modp (i.e. that (-np)=1); second, that ℤ⁢[-n] is a UFD. It is known that the only imaginary quadratic rings ℚ⁢(-n) that are UFDs are those for n=1,2,3,7,11,19,43,67,163, and the only n in that set for which ℤ⁢[-n] is the ring of integersMathworldPlanetmath are n=1,2.

So for n=1,2, and p an odd prime, p=x2+n⁢y2 if and only if (-np)=1, while for the other n (3, 7, 11, 19, 43, 67, 163), the ring of integers of ℚ⁢(n) is not ℤ⁢[-n], so ℤ⁢[-n] is not integrally closed and thus is not a UFD and hence this proof will not work for those values of n.

The cases n=3 and n=7 can be dealt with by the following relatively simple argument (which, as you can see, does not generalize further): Corollary 6 in the article on representation of integers by equivalent integral binary quadratic forms states that if p is an odd prime not dividing n, then (-np)=1 if and only if p is represented by a primitive form (http://planetmath.org/IntegralBinaryQuadraticForms) of discriminantPlanetmathPlanetmathPlanetmathPlanetmath (http://planetmath.org/RepresentationOfIntegersByEquivalentIntegralBinaryQuadraticForms) -4⁢n. So if there is only one reduced form (http://planetmath.org/ReducedIntegralBinaryQuadraticForms) with that (which must perforce be the x2+n⁢y2), then we are done. But h⁢(-4⁢n)=1⇔n=1,2,3,4,7 (see this article (http://planetmath.org/ThereIsAUniqueReducedFormOfDiscriminant4nOnlyForN12347)). n=1 and n=2 were dealt with above. n=4 is the form x2+4⁢y2, and if an odd prime p can be written p=x2+4⁢y2, then clearly we have also p=x2+(2⁢y)2; conversely, if p=x2+y2, then either x or y is even, so that also p=x2+2⁢(y′)2. Thus n=4 has the same set of solutions as n=1. But we do get two new cases, n=3 and n=7, for which have shown that p is representable as x2+n⁢y2 if and only if (-np)=1, i.e. -n is a square modp. We have thus proven

Theorem 2.

If n=1, 2, 3, 4, or 7, then an odd prime p can be written as p=x2+n⁢y2 with x, y∈Z if and only if

(-np)=1

i.e. if and only if -n is a square modp.

References

Cox, D.A. “Primes of the Form x2+n⁢y2: Fermat, Class Field Theory, and Complex MultiplicationMathworldPlanetmath”, Wiley 1997.

Title representing primes as x2+n⁢y2
Canonical name RepresentingPrimesAsX2ny2
Date of creation 2013-03-22 15:49:28
Last modified on 2013-03-22 15:49:28
Owner rm50 (10146)
Last modified by rm50 (10146)
Numerical id 17
Author rm50 (10146)
Entry type Theorem
Classification msc 11A41
Related topic ThuesLemma2