Before I can ask my question, I need to introduce some terminology and background.
Statement 1: Let $n$ be one of Euler's 65 convenient numbers. Then we can find congruence conditions such that
$$p=x^2+ny^2 \Leftrightarrow c_1, \ldots, c_r \mod{N}$$ See for example this article why this is possible. On a related note: one can even show that for other numbers it is impossible to provide congruence conditions (cf. here, here, and page 19 here)
.
Statement 2: The more general case goes as follows.
.
Statement 3: Finding the HCF for $K=\mathbb{Q}(\sqrt{-n})$ is difficult. However, when $n$ is one of Euler's 65 convenient numbers then the Hilbert class field of $K$ equals the genus field of $K$. The genus field can be easily determined as follows:
Now, basically what I want to do is the following:
- Consider cases when the genus field equals the Hilbert class field (i.e. Euler's convenient numbers)
- Construct a primitive element for the genus field (cf. here)
- Next, from the minimal polynomial of the Hilbert class field, I want to recover congruence conditions through quadratic reciprocity.
Two worked out examples:
The genus field of $K=\mathbb{Q}(\sqrt{-5})$ is $M=K(\sqrt{5})=K(i)$. Now, the Hilbert class field equals the genus field, so the minimal polynomial for the primitive element $i$ is $x^2 + 1$. From the above theorem we get the condition that $$x^2 + 1 \equiv 0 \mod{p}$$ must be solvable. But this just means that $-1$ is a quadratic residue modulo $p$. Together with the other condition of the theorem, which says that $-5$ is a quadratic residue modulo $p$, we find that: $$p = x^2 + 5y^2 \Leftrightarrow p \equiv 1,9 \mod{20}$$
The genus field of $K=\mathbb{Q}(\sqrt{-21})$ is $M=K(\sqrt{-3},\sqrt{-7})$. To calculate the minimal polynomial for the primitive element $\sqrt{-3} + \sqrt{-7}$, we use Wolfram: $$f(x)=x^4+20x^2+16=(x^2+10)^2-84$$ This polynomial is solvable modulo $p$ if $$y^2 \equiv 84 \mod{p}$$ is solvable, AND $$x^2 \equiv - 10 \mod{p}$$ has a solution. Each condition can, via quadratic reciprocity, be expressed by a congruence, and putting the different congruences together (via the AND operator) gives us again a congruence condition.
Problem:
The above method seems to break down when we consider more than $2$ elements. (eg. $\sqrt{-3}+\sqrt{5}+\sqrt{-7}$). Wolfram does not give a nice "recursive quadratic" polynomial. However, I suspect that congruence conditions can be recovered in a similar way.