When does a $n \in \mathbb{Z}$ can be written as $n=A^2+B^2$?

83 Views Asked by At

I want to establish the condition which will determine when does an element $~n \in \mathbb{Z}$ can be written as two integer squares i.e., $~n=A^2+B^2$ for $A, B \in \mathbb{Z}$. Now I have found the following theorem in the text Abstract Algebra by Dummit & Foote [Chapter~8; Corollary~19] but I have some trouble in its proof given in the book:

Theorem 1. Let $n$ be a positive integer and write $$n=2^kp_1^{a_1}\dots p_r^{a_r}q_1^{b_1}\dots q_r^{b_s}$$ where $p_1,\dots p_r$ are distinct primes congruent to $1~\text{mod}~4$ and $q_1,\dots q_s$ are distinct primes congruent to $3~\text{mod}~4$. Then $n=A^2+B^2 ~\text{with}~A, B \in \mathbb{Z}$, if and only if each $b_i$ is even.

$Proof.$ Now $n$ is sum of two integer squares, $n=A^2+B^2$ is equivalent to the question of whether $n$ is the norm of an element $A+Bi$ in the Gaussian integers, i.e., $n=A^2+B^2=N(A+Bi)$. Writing $A+Bi=\pi_1\dots \pi_k$ as product of irreducibles (uniquely up to units) it follows from the explicit description of the irreducibles in $\mathbb{Z}[i]$ in following Proposition that $n$ is a norm if and only if the prime divisors of $n$ that are congruent to $3$ mod $4$ occur to even exponents.

Proposition. The irreducible elements in the Gaussian integers$\mathbb{Z}[i]$ are follows:

  • $1+i~$ (which has norm $2$)
  • the primes $p \in \mathbb{Z}$ with $p \cong 3 (\text{mod} 4)$ (which have norm $p^2$), and
  • $a+bi,~a-bi$, the distinct irreducible factors of $p=a^2+b^2=(a+bi)(a-bi)$ for the primes $p \in \mathbb{Z}$ with $p \cong 1 (\text{mod} 4)$ (both of which have norm $p$).

$Proof.$ Can be found in the book by Dummit & Foote [Proposition~18]

Now my problem is about the proof of Theorem 1...how does the conclusion drawn by saying:

"....explicit description of the irreducibles in $\mathbb{Z}[i]$ in following Proposition that $n$ is a norm if and only if the prime divisors of $n$ that are congruent to $3$ mod $4$ occur to even exponents."

Can anyone please help me to understand this proof of Theorem 1. Thank you.