# Distribution of Subsets of Primes

Primes may be divided in to sets: $p=4n\pm1$. Gauss showed, that if $p=4n+1$, it may be written also as $p=a^2+b^2$. From LagrangesFour-SquareTheorem, we know

that $g(2)=4$, where 4 may be reduced to 3 except for numbers of the form $4^n(8k+7)$,... (every rational integer is the sum of a fixed number $g(n)$ of $n$th powers of positive integers)

So prime numbers split in $3$ cases:

• $p=4n+1=a^2+b^2$, e.g. $5=4+1=1^2+2^2$,
• $p=8n+3=a^2+b^2+c^2$, e.g. $11=8+3=9^2+1^2+1^2$
• $p=8n+7=a^2+b^2+c^2+d^2$, e.g. $7=2^2+1^2+1^2+1^2$.

How large is the fraction of every case among all primes?

I don't remember where, but I think I once read that the truth of Riemann's hypothesis has an influence on the $4n\pm1$ distribution.

EDIT2 A discussion of the error terms is appreciated.

EDIT It seems possible to write every natural number and therefore every prime as a product of conjugate quaternions $(a\pm ib\pm jc \pm kd)(a\mp ib\mp jc\mp kd)$.

The Prime Number Theorem for Arithmetic Progressions tells us that the number of primes in those three classes up to $x$ is asymptotic to $x/(2\log x)$, $x/(4\log x)$, and $x/(4\log x)$, respectively. The generalized Riemann Hypothesis (the version of the Riemann Hypothesis for L-functions) might say something about the error terms.
• For the interested readers: Prime Number Races from there: $\# \{\text{primes$4n+1\le x$} \}-\# \{\text{primes$4n+3\le x$} \}\ge \frac{\sqrt{x}}{2\ln x}\ln \ln x$. Thanks a lot, Gerry. – draks ... May 25 '12 at 17:25