Finite set of quadratic forms representing all prime numbers I ask if one can determine a finite set of quadratic forms
$$mx^2+ny^2$$
with $\,m\,$ and $\,n\,$ positive integers s.t. $(m,n)=1$, capable to represent all prime numbers.
We could choose, for instance, the set
$$S_1=\{x^2+y^2,\;x^2+2y^2\}$$
but primes congruent to $7$ (mod $8$) don't belong to $S_1$. The set
$$S_2=S_1\cup\{x^2+3y^2\}$$
doesn't represent primes congruent to $23$ (mod $24$). The set
$$S_3=S_2\cup\{2x^2+5y^2\}$$
doesn't represent primes congruent to $71$ (mod $120$) and congruent to $119$ (mod $120$), and so on ...
 A: $\newcommand\lgn[2]{(#1\backslash#2)}$
There is no such finite set of forms.
Lemma
If $f$ is a positive-definite binary quadratic form, and $f$'s discriminant is $D$, and $f$ represents a prime $p$, then $D$ is a square modulo $4p$.
Theorem 1
If $f$ is a positive-definite binary quadratic form of discriminant $D$, and if $p$ is prime, and $-p$ is a square modulo $|D|$, then $f$ does not represent $p$.
Proof.
Suppose not. Then let there be a counterexample where $\lgn{-p}{|D|}=1$ but $f$ does represent $p$. Then $\lgn{D}{4p}=1$ (by the lemma), so $\lgn{D}p=1$.
Case 1. $D$ is odd. Then $|D|=3\mod 4$, so
$\lgn{-1}{|D|}=-1$, so $\lgn{p}{|D|}=\lgn{4p}{|D|}=-1$.
Case 1a. $p=1\mod 4$. Then $\lgn{-1}p=\lgn{|D|}p=1$. By quadratic reciprocity, $\lgn{p}{|D|}=1$; contradiction.
Case 1b. $p=3\mod 4$. Then $\lgn{-1}p=-1$, so $\lgn{|D|}p=-1$. By quadratic reciprocity, $\lgn{p}{|D|}=1$; contradiction.
Case 2. $4\mid D$. Let $D=4d$. Let $q$ be an odd prime factor of $|d|$, and let $o$ be the largest odd factor of $|d|$. As $\lgn{-p}{|D|}=1$, $\lgn{-p}{|d|}=1$, so $\lgn{-p}q=1$.
Moreover, $-p=1^2=1\mod 4$, so $p=3\mod 4$, so $\lgn{-1}p=-1$. As $\lgn{D}{4p}=1$, $\lgn{d}p=1$, so $\lgn{|d|}p=-1$.
Case 2a. $q=1\mod 4$. Then, $\lgn{-1}q=\lgn{p}q=1$. By quadratic reciprocity, $\lgn{q}p=1$.
Case 2b. $q=3\mod 4$. Then, $\lgn{-1}q=\lgn{p}q=-1$. By quadratic reciprocity, $\lgn{q}p=1$.
So, modulo $p$, every odd prime factor of $|d|$ is a square, so $\lgn{o}p=1$.
If $d$ is odd, this means that $\lgn{|d|}p=1$, so $\lgn{d}p=\lgn{D}p=-1$ (as $|d|=-d=3\mod 4$). Contradiction.
If $d$ is even, then $8\mid D$. $\lgn{-p}{|D|}=1$. Therefore, modulo 8, $-p=1$ and $p=-1$. Therefore, $\lgn{2}p=1$ but $\lgn{-1}p=-1$. $\lgn{o}p=\lgn{2}p=1$, so $\lgn{|d|}p=1$.
Therefore, $\lgn{d}p=\lgn{D}p=-1$. Contradiction.
Theorem 2
If $C$ is the set of integers in a residue class modulo $m$, and $C$ contains the negative of any square coprime to $m$, then no positive-definite binary quadratic form represents all primes in $C$.
Proof.
Let $-r^2\in C$ with $r$ coprime to $m$.
Write $P(t,u)$ for the set of primes $p=t\mod u$. Then it is required to prove that no such form represents $P(-r^2, m)$.
Let $f$ be such a form, and $D$ its discriminant. Let $L$ be a common multiple of $m$ and $|D|$.
$P(-r^2, L)$ is not empty (Dirichlet), and $P(-r^2, L)\subset P(-r^2, m)$.
By theorem 1, $f$ represents no primes in $P(-r^2, |D|)$. In particular, $f$ represents no primes in $P(-r^2, L)$, so $f$ does not represent all primes in $P(-r^2, m)$.
Theorem 3
No finite number of positive-definite binary quadratic forms collectively represent all primes.
Proof.
Suppose there were a finite set of such forms. Let $m$ be a common multiple of their discriminants, and $r$ coprime to $m$. Then let $C$ be the residue class of $-r^2$ modulo $m$. Then $C$ contains primes (Dirichlet). By theorem 2, none of these forms represents any of those primes.
