$p=4n+3$ never has a Decomposition into $2$ Squares, right?

Yes, as it has been pointed out, if $a^2+b^2$ is odd, one of $a$ and $b$ must be even and the other odd. Then $$ (2m)^2+(2n+1)^2=(4m^2)+(4n^2+4n+1)=4(m^2+n^2+n)+1\equiv1\pmod{4} $$ Thus, it is impossible to have $a^2+b^2\equiv3\pmod{4}$.

In fact, suppose that a prime $p\equiv3\pmod{4}$ divides $a^2+b^2$. Since $p$ cannot be written as the sum of two squares, $p$ is also a prime over the Gaussian integers. Therefore, since $p\,|\,(a+ib)(a-ib)$, we must also have that $p\,|\,a+ib$ or $p\,|\,a-ib$, either of which implies that $p\,|\,a$ and $p\,|\,b$. Thus, the exponent of $p$ in the factorization of $a^2+b^2$ must be even.

Furthermore, each positive integer whose prime factorization contains each prime $\equiv3\pmod{4}$ to an even power is a sum of two squares.

Using the result about quadratic residues in this answer, for any prime $p\equiv1\pmod{4}$, we get that $-1$ is a quadratic residue $\bmod{p}$. That is, there is an $x$ so that $$ x^2+1\equiv0\pmod{p}\tag{1} $$ This means that $$ p\,|\,(x+i)(x-i)\tag{2} $$ since $p$ can divide neither $x+i$ nor $x-i$, $p$ is not a prime in the Gaussian integers, so it must be the product of two Gaussian primes (any more, and we could find a non-trivial factorization of $p$ over the integers). That is, we can write $$ p=(u+iv)(u-iv)=u^2+v^2\tag{3} $$ Note also that $$ 2=(1+i)(1-i)=1^2+1^2\tag{4} $$ Suppose $n$ is a positive integer whose prime factorization contains each prime $\equiv3\pmod{4}$ to even power. Each factor of $2$ and each prime factor $\equiv1\pmod{4}$ can be split into a pair of conjugate Gaussian primes. Each pair of prime factors $\equiv3\pmod{4}$ can be split evenly. Thus, we can split the factors into conjugate pairs: $$ n=(a+ib)(a-ib)=a^2+b^2\tag{5} $$ For example, $$ \begin{align} 90 &=2\cdot3^2\cdot5\\ &=(1+i)\cdot(1-i)\cdot3\cdot3\cdot(2+i)\cdot(2-i)\\ &=[(1+i)3(2+i)]\cdot[(1-i)3(2-i)]\\ &=(3+9i)(3-9i)\\ &=3^2+9^2 \end{align} $$ Thus, we have shown that a positive integer is the sum of two squares if and only if each prime $\equiv3\pmod{4}$ in its prime factorization occurs with even exponent.


Yes. $a^2 \equiv -b^2 \ \ (p)$. Then raise to the $\frac{p-1}{2}$ power and use Fermat's little Theorem. You get $p|2$.