About the Set of $\mathbb{S}=\{ n | n = a^2+b^2, a, b \in \mathbb{Z}. \}$
This is also known as OEIS A001481.
I just found an interesting one from this set.
From my favorite identity, Brahmagupta-Fibonacci's identity, we can get:
$(ab+cd)^2+(ad-bc)^2=(a^2+b^2)(c^2+d^2).$
So, we get...
If $a, b \in \mathbb{S}, ab \in \mathbb{S}.$
This is a well-known fact for the set.
Now, I'm curious about the prime number of the set $\mathbb{S}$.
For example, $2, 5, 9, 13, 17, 29, 37, 41, 49, 53, 61, 73, 89, 97, 101, 109, 113, 121, \cdots$ are the prime number of $\mathbb{S}$.
These are all the prime numbers except for $9, 49, 121, \cdots$.
And amazing thing is that they are all square numbers.
So, I'm wondering if the prime numbers of $\mathbb{S}$ except the prime numbers in $\mathbb{N}$ have some pattern.
I can see that they are $(4k+3)^2$... Is it right?
A well-known theorem often attributed to Fermat shows that a prime $p \in \mathbb{N}$ is a sum of two squares if and only if $p = 2$ or $p \equiv 1 \bmod 4$. More generally, a positive integer $n$ is a sum of two squares if and only if, for each prime $q \equiv 3 \bmod 4$ dividing $n$, the largest number $k$ such that $q^k \mid n$ is even. Stated differently, $n$ is a sum of two squares if and only if each prime congruent to $3$ mod $4$ divides $n$ an even number of times.
This is sometimes called the sum of two squares theorem.
This shows that the "primes" of the set $\mathbb{S}$ are $2$, typical primes $p \equiv 1 \bmod 4$, and squares $q^2$ of primes $q \equiv 3 \bmod 4$. This is very nearly what you suggest at the end of your post.