# Representability of primes by quadratic forms and congruence conditions

Let $$Q(x,y) = ax^2 + bxy + cy^2, \quad a,b,c \in \mathbb{Z}$$ be a binary quadratic form. We say an integer $$n$$ is representable by $$Q$$ if $$n = Q(x,y)$$ for some $$x,y \in \mathbb{Z}$$. A theorem due to Fermat shows that a prime $$p$$ is representable by $$x^2 + y^2$$ if and only if $$p = 2$$ or $$p \equiv 1 \pmod 4$$. Fermat also proved similar theorems about the quadratic forms $$x^2 + 2y^2$$ and $$x^2 + 3y^2$$.

Given a quadratic form $$Q$$, one might ask if there exists an theorem analogous to those of Fermat. More precisely, does there exist a modulus $$M \in \mathbb{N}$$ and congruence classes $$a_1,\ldots,a_k$$ such that for all but finitely many primes $$p$$, we have that $$p$$ is representable by $$Q$$ if and only if $$p \equiv a_1,\ldots,a_k \pmod M.$$ We say a natural number $$N \in \mathbb{N}$$ is convenient if the above holds for the quadratic form $$Q_N(x,y) = x^2 + Ny^2$$. Gauss proved that the $$65$$ numbers $$1,2,3,4,7,5, 6, 8, 9, 10, 12, 13, 15, 16, 18, 22, 25, 28, 37, 58, 21, 24, 30, 33, 40, 42, 45, 48, 57, 60, 70, 72, 78, 85, 88, 93, 4 102, 112, 130, 133, 177, 190, 232, 253 105, 120, 165, 168, 210, 240, 273, 280, 312, 330, 345, 357, 8 385, 408, 462, 520, 760 840, 1320, 1365, 1848$$ are convenient, and Weinberger showed that there are at most two additional convenient numbers.

My question is what is known about the general case? For instance, is there a finite list of quadratic forms for which a Fermat-type theorem holds?