Given an arbitrary (but fixed) positive definite primitive integral binary quadratic form $g(x, y)=ax^2+bxy+cy^2$, and let $m$ be an arbitrary integer. We will denote the discriminant of $g$ by $D=D_g=b^2-4ac$. The following problems are very interesting to me:

$\color{Red}{\text{A}}$) Which integers can be represented by the quadratic form $g$?

$\color{Red}{\text{B}}$) What is the exact number of representations? i.e. what is the exact number of integral solutions to the equation $g(x,y)=m$, where $g$ is a fixed quadratic form as $m$ varies? $\color{Lime}{\text{C) My question is}}$: Is there any necessary and sufficient condition for a prime to be represented by an arbitrary primitive binary quadratic form $ax^2+bxy+cy^2$?

(0) When the form $g$ is the principal form of the form class group $\mathcal{C}(D)$, then we can give a necessary and sufficient condition under which a prime number is representable by $g(x,y)$. (Choose $\epsilon_D \in \{ 0, 1 \}$ such that $D \stackrel{2}{\equiv} \epsilon_D$, then a representative for the principal class would be $P_{D}=x^2+\epsilon_Dxy+\frac{\epsilon_D-D}{4}y^2$) (To being more precise, it should not be equal, it should just be equivalent)

From now on $D$ would denote an arbitrary negative Discriminant which is fixed, and $P$ will denote the principal quadratic form of discriminant $D$. Also, we will use this notation $h=\vert \mathcal{C}(D) \vert$. Also, by a quadratic form, we will mean a positive definite primitive integral binary quadratic form.

The main theorem of the book «Primes of the form $x^2+ny^2$» says that:

**The Main Theorem**.
Consider the principal form $P(x, y)$. and let $K:=\mathbb{Q}(\sqrt{D})$,
Then $\mathcal{O}=\mathbb{Z}[\frac{D+\sqrt{D}}{2}]$ would be an order of conductor $f$,
(where $D=f^2d_K$,
and $d_K$ is the discriminant of the imaginary quadratic field $K=\mathbb{Q}(\sqrt{D})$
and $D$ is the discriminant of the quadratic form $g$.)
in the ring of integers $\mathcal{O}_K=\mathbb{Z}[\frac{d_K+\sqrt{d_K}}{2}]$
in the imaginary quadratic field $K=\mathbb{Q}(\sqrt{D})$.
Let $L=K(\alpha)$ be the ring class field of the order $\mathcal{O}=\mathbb{Z}[\frac{D+\sqrt{D}}{2}]$ in the imaginary quadratic field $K=\mathbb{Q}(\sqrt{D})$. And let $f_{D, h}(x)$ be the minimal polynomial of $\alpha$, note that the degree of $f_{D, h}(x)$ is $h$. And let $p$ be a prime such that $p\nmid D \times \text{Disc}(f_{D, h}(x))$, then $p$ can be represented by the principal form $p=P_{D}=x^2+\epsilon_Dxy+\frac{\epsilon_D-D}{4}y^2$ if and only if $(D/p)=1$ and $f_{D, h}(x) \cong 0 \mod p$ has a solution; in other words, it has the form $p=P_{D}=x^2+\epsilon_Dxy+\frac{\epsilon_D-D}{4}y^2$ if and only if both of the equations $x^2-D \cong 0$ and $f_{D, h}(x) \cong 0$ has a solution $\mod p$.

(1) Can we have some **generalized results** if we replace the principal form with any arbitrary positive definite binary quadratic form? Could we find a similar statement for the necessary and sufficient condition under which a prime number can be represented by an arbitrary positive definite binary quadratic form?

To clarify what I mean:

(2) For instance, if each genus contains only one class, then the answer would be positive, and it is given by congruence classes. Being more precise, we can determine the set of primes represented by $g$, by congruence conditions over $\mathbb{Z}$, if and only if the form class group $\mathcal{C}(D)$, equivalently the proper ideal class group $\mathcal{C}(\mathbb{Z}[\frac{D+\sqrt{D}}{2}])$, is isomorphic to $(\mathbb{Z}/2\mathbb{Z})^r$ (Each genus would contain only one class if and only if these two equivalent conditions are satisfied), Also, in this case we can give a completely satisfying answer to the question $\color{Red}{\text{B}}$. Also, note that there are only finitely many of them, for the case of even discriminant see Euler's Convenient Numbers.

$\color{Green}{\text{Part (3)}}$ Or if $g(x,y)$ is a quadratic form of order $3$, then $\{ P_D, g^{1}, g^{-1} \}$ form a group of order $3$ in the form class group $\mathcal{C}(D)$. Also, we know that the Ideal class group $\mathcal{C}(\mathcal{O})$ is isomorphic to the form class group $\mathcal{C}(D)$, and so there is a corresponding subgroup of order $3$ in $\mathcal{C}(\mathcal{O})$, and let us denote the fixed field of this subgroup by $H$, which would be an intermediate field of $L/K$, of degree $\frac{h}{3}$ over $K=\mathbb{Q}(\sqrt{D})$. Note that the characteristic of $K$ is zero, so there exists a primitive element $\beta$ such that $H=K(\beta)$, and let $f_{D, {\frac{h}{3}}}(x)$ be its minimal polynomial, notice that its degree is $\frac{h}{3}$. Then by **The Main Theorem**, we can see that a prime number $p$ with $p\nmid D \times \text{Disc}(f_{D, h}(x)) \times \text{Disc}(f_{D, {\frac{h}{3}}}(x))$, is represented by $g(x,y)$ if and only if $(D/p)=1$ and $f_{D, {\frac{h}{3}}}(x) \cong 0 \mod p$ has a solution and $f_{D, h}(x) \cong 0 \mod p$ does not have any solution. Also, we can give similar statements if $g(x,y)$ is a quadratic form of order $n=1, 2, 3, 4, 6$ because these are the only numbers whit $\varphi(n) \leq 2$, and in these cases we can distinguish the element {1} in $\mathbb{Z}/n\mathbb{Z}$ up to multiplication by the subgroup $\{ \pm 1\}$.

(4) Although we can give a necessary and sufficient condition in these special cases, but even this is not satisfactory, and I am not looking for this kind of condition; notice that in the main theorem if $p=P_D(x,y)$, then some equation has a solution $\mod p$. But the necessary and sufficient condition for these cases in $\color{Green}{\text{Part (3)}}$, has a somehow reverse nature: For instance, assume that $h(D)=3$, and also let $g(x,y)$ be a quadratic form of order $3$, then the argument in $\color{Green}{\text{Part (3)}}$ implies that a prime $p$ is represented by this quadratic form, if some equation does not have a solution $\mod p$, so we can not consider the trivial condition for the case $h(D)=3$ as a generalization of The Main Theorem in a reasonable way.

(5) I believe the answer to my question is negative. If we restrict ourselves to the case Discriminant= $-92$ or $-108$, then the class group has $3$ classes in both of the cases, and a complete set of representatives can be given as $P_{23}=x^2+23y^2$ & $g_{23}^{\pm}=3x^2\pm2xy+8y^2$, and $P_{27}=x^2+27y^2$ & $g_{27}^{\pm}=4x^2\pm2xy+7y^2$, and let $f_{-92, 3}=x^3-x-1$ & $f_{-108, 3}=x^3-2$. Let $D=-92$ or $D=-108$, Let $p$ be a prime which does not divide $D$, nor the discriminant of $f_{D, 3}(x)$ and also $(D/p)=1$. Suppose on contrary that the answer to my question is positive, then there exists polynomial $F_{D, 3}(x)$ such that: for every prime $p$ with $(D/p)=1$, exactly one of the polynomials $f_{D, 3}(x)$ or $F_{D, 3}(x)$ has a solution $\mod p$, and the other one does not have a solution, but I can not continue to gain a contradiction.

I am looking for **$\color{Green}{\text{any kind of generalization of the main theorem}}$** (I am looking for a generalization from principal form to any arbitrary binary quadratic form, but any other kind of generalizations are welcome, for example, some related facts about quadratic forms in more variables) of that book, and I searched through many works of literature and many papers, but I didn't find anything. I am aware that questions $\color{Red}{\text{A}}$ and $\color{Red}{\text{B}}$ involving too many deep areas in number theory, and maybe giving a complete answer to them is impossible in some sense, and I am not asking for the answers to them. I just asking for the question $\color{Lime}{\text{C}}$; and if the answer is positive, $\color{Green}{\text{to be introduced to other fields involving them}}$, also, anything regarding the questions $\color{Red}{\text{A}}$ and $\color{Red}{\text{B}}$, would be welcome.

$\color{Green}{\text{Any guidance on other areas and directions relating to this problem is welcome.}}$

Corollary 2.6 of the first chapter [Page 24]of the second edition of the book Primes of the form $x^2+ny^2$ (that corollary was stated only for even quadratic forms, but it can be reformed to work for all cases. Or it can be deduced by Dedkind Factorization theorem). $\endgroup$Theorem 7.7 of the second chapter [Page 123]of that book, it follows that one of the primes lying above $p$ must belong to the corresponding class to $f$, in the proper ideal class group of the order $\mathcal{O}$, and the other one should belong to the corresponding class to $f^{-1}$. And both of the proofs of Corollary 2.6 and Theorem 7.7 are done in a quite elementary manner, without any class field theoretic phenomena. $\endgroup$1more comment