Let $n = 2 \times p^e × q^k$ where $p \equiv 3 \pmod 4$, $e$ is even, $q \equiv 1 \pmod 4$, and $k$ is any natural number.
Show that $n$ can be expressed as a sum of two squares.
We will use Sum of Two Squares Theorem (8.5).
Let $m$ be a positive integer given by $m = p_1 \times p_2 \times \ldots × p_r × N^2$ where the $p$’s are distinct primes. Then $m$ can be expressed as a sum of two squares, provided every prime $p_j$ satisfies $p_j = 2$ or $p_j \equiv 1 \pmod 4$ for $j= 1, \ldots , r$.
Because $e$ is even, we can write it as $e=2a$, for some natural number $a$.
There are two cases for $k$, even and odd. Let's consider both in turn.
Case $k$ even
If $k$ is even, we can write it as $k=2b$ for some natural number $b$. And so
$$ n = 2 \times p^e \times q^k = 2 \times (p^a)^2 \times (q^b)^2 = 2 \times (p^aq^b)^2 $$
By the Sum of Two Squares Theorem (8.5), $n$ can be written as a sum of two squares.
Case $k$ odd
If $k$ is odd, we can write it as $k=2b+1$ for some natural number $b$. And so
$$ n = 2 \times p^e \times q^k = 2 \times (p^a)^2 \times (q^b)^2 \times q= 2 \times (p^aq^b)^2 \times q $$
Since $q \equiv 1 \pmod 4$, by the Sum of Two Squares Theorem (8.5), $n$ can be written as a sum of two squares.