# General Primality Conditions in the UFD $\mathbf{Q}(\sqrt{-d})$

Suppose $\mathcal{O}_{\mathbf{Q}\left(\sqrt{-d}\right)}$ is a UFD, so $d=1,2,3,7,11,19,43,67,163$. Are there general criteria determining whether an element in the integers of $\mathbf{Q}(\sqrt{-d})$ is prime or not? As with $\mathbf{Z}[i]$, $\mathbf{Z}[\sqrt{-2}]$, and $\mathbf{Z}[\omega]$, can we say: An element in the ring of algebraic integers of $\mathbf{Q}(\sqrt{-d})$ is prime if

• it is a rational prime $p\in\mathbf{Z}$ such that $p$ is not the norm of any element in $\mathbf{Q}(\sqrt{-d})$, or
• it is an element with nonzero imaginary part such that its norm is a rational prime?

Furthermore, I noticed that in the case of $\mathbf{Z}[\omega]$, rational primes expressible as $x^2+xy+y^2$ are identical to those expressible as $x^2+3y^2$; primes $p$ such that $p\equiv 1\pmod{3}$. Thus, in the integers of $\mathbf{Q}(i)$, $\mathbf{Q}(\sqrt{-2})$, and $\mathbf{Q}(\sqrt{-3})$, the conditions for primality depend on which rational primes can be expressed as $x^2+dy^2$, for $d=1, 2, 3$, which boils down to computing the Legendre symbols $\left(\frac{-1}{p}\right)$, $\left(\frac{-2}{p}\right)$, and $\left(\frac{-3}{p}\right)$. Can this be generalized to those $d$ such that $\mathbf{Q}(\sqrt{-d})$ is a UFD, i.e., can prime elements of the integers in $\mathbf{Q}(\sqrt{-d})$ be characterized based on which rational primes are expressible as $x^2+dy^2$ - thus depending on $\left(\frac{-d}{p}\right)$? I'm slightly unsure about this kind of generalization since the norms are different; could the case in $\mathbf{Q}(\sqrt{-3})$ just be a coincidence?

In summary (tl;dr), what is the best/easiest way to determine if an element is prime in the integers of the UFD $\mathbf{Q}(\sqrt{-d})$? Any help is greatly appreciated.

-
You sure these are all UFD? They are not all Euclidean. The thing about 3 is indeed a coincidence, although $x^2 + 7 y^2$ and $x^2 + x y + 2 y^2$ represent the same odd numbers with integral $x,y$ –  Will Jagy Jan 27 at 2:41
Ummm. For your odd $d,$ what you want is $x^2 + xy + \frac{1+d}{4} y^2$ –  Will Jagy Jan 27 at 2:51
So the generic primality conditions hold right? Now it is a problem of determining what primes can be written as $x^2+xy+\frac{d+1}{4}y^2$. –  Siddharth Prasad Jan 27 at 2:55
I seem to have found an answer in Qiaochu Yuan's post here: math.stackexchange.com/questions/92771/…. Again, thanks for your help. –  Siddharth Prasad Jan 27 at 4:13