# primes of the form $a^2+b^2=x^2-xy+y^2$?

Let $a,b,x,y$ be strict positive integers. Im intrested in primes $p$ such that $p=a^2+b^2=x^2-xy+y^2$. What is the analogue PNT for these type of primes ? I think these primes are all the primes $p \equiv 1 \pmod{12}$.

-
so it's just prime number theorem for the arithmetic progression 1 mod 12? no need to consider the form once you know the congruence. – user58512 Jan 31 '13 at 21:53

By Fermat's theorem on sums of two squares, $p$ can be written as $a^2+b^2$ iff $p \equiv 1 \pmod 4$ or $p = 2$. By this question, $p$ can be written as $x^2-xy+y^2$ iff $p \equiv 1 \pmod 3$ or $p = 3$. A prime $p$ satisfies both if and only if $p \equiv 1 \pmod {12}$, by the Chinese Remainder Theorem.

-
Also note that by the Prime Number Theorem for arithmetic progressions, the number of these primes less than $x$ is asymptotically $\frac{Li(x)}{\varphi(12)}=\frac{Li(x)}{4}$. – Tib Jan 31 '13 at 22:11
To expand @Tib's comment, there are four residue classes mod 12 which are coprime to 12 (1,5,7,11) and the primes are (ultimately, on average) equally divided between them. – Mark Bennet Jan 31 '13 at 22:20