I want to know which primes $p$ can be written in the form $p=x^2-ny^2$ for given $n \in \mathbb{N}$. If $n$ is squarefree, $n \not\equiv 1 \mod 4$ and $\mathbb{Z}[\sqrt{n}]$ is a principal ideal domain, this has been answered herehere. Is anything known about the other cases?