TITLE: Primes of the form $x^2+ny^2+mz^2$ and congruences.
QUESTION [20 upvotes]: This is a sequel of this question where I asked for which positive integer $n$ the
set of primes of the former $x^2+ny^2$ was defined by congruences (a set of primes $P$ is defined by congruences if there is a positive integer $d$ and a subset $A$ of $\mathbb{Z}/d\mathbb{Z}$ such that a prime $p$ is in $P$ if and only if $p$ mod $d$ is in $A$, up to a finite number of exceptions). I was taught there that the answer was "exactly when $n$ is idoneal", that there is finitely many idoneal numbers, and that all are known but perhaps one.

When is the set of primes of the form $x^2+ny^2+mz^2$ ($x,y,z \in \mathbb{Z})$ defined by congruences?

My motivation is not just an idle ternary generalization of the binary case.  I really met this question while working on a problem concerning modular forms, and also the slightly more general question, given a fixed positive integer $a$: when is the set of primes $p$ such that $ap$ has the form $x^2+ny^2+mz^2$ ($x,y,z \in \mathbb{Z})$ defined by congruences?
I am well aware that since the set of integers represented by a ternary quadratic form is not stable by multiplication, it is much less
natural to ask the question for prime numbers instead of all positive integers than in the case of a binary quadratic form.
Yet this is really the question for primes that appears in my study (for about a dozen specific ternary forms, actually).
I have found a very interesting paper by Dickson (Ternary quadratic forms and congruences. Ann. of Math. (2) 28 (1926/27), no. 1-4, 333–341.) which solves the question for the integers represented by $x^2+ny^2+mz^2$: there is only a finite explicit numbers of $(n,m)$ such that this set of integers is defined by congruences (in the obvious sense). But the proof does not seem (to me) to be easily generalizable to primes. Other mathscinet research did not give me any more informations.
When I try to think to the question, I meet an even more basic (if perhaps slightli more sophisticated) question that I can't answer:

When is the set of primes of the form $x^2+ny^2+mz^2$ ($x,y,z \in \mathbb{Z})$ Frobenian? (Is it "always"?)

A set of primes $P$ is called Frobenian (a terminology probably introduced by Serre) if there is a finite Galois extension $K/\mathbb{Q}$, and a subset $A$ of Gal$(K/\mathbb{Q})$ stable by conjugacy  such that a prime  $p$ is in  $P$ if and only if Frob${}_p \in A$, except for a finite number of exceptions. A set determined by congruences is a Frobenian set for which
we can take $K$ cyclotomic over $\mathbb{Q}$, which is the same by Kronecker-Weber as abelian over $\mathbb{Q}$. For a quadratic binary
quadratic form (for example $x^2+ny^2$), the set of represented primes is always Frobenian ($K$ can be taken as the
ring class field of $\mathbb{Z}[\sqrt{-n}]$, and $A=\{1\}$, as explained in Cox's book). But I fail to see the reason
(which may nevertheless be trivial) for which the same result would be true for a general ternary quadratic form.
I should add that for my specific ternary forms, I can show that the set is Frobenian, but I am not sure how to extend the argument to all ternary quadratic forms.
Finally, let me say that I would be interested in any book, survey or references on this kind of question (which surely must have been studied), and that I am also interested in analog questions for quaternary quadratic forms (which might be easier,
because of multiplicative properties related to quaternions).

REPLY [4 votes]: Dear Joel,
I noticed your request for texts. The most informative chapter on positive ternaries, with the intent of predicting the represented integers, is in Dickson M.E.N.T. (1939). I have typed up a list of my books. For the moment, my websites are down, the host computer fried a power supply. So, I am including the link to my preprints on the arXiv, the papers with Alex Berkovich may be just the thing, overlap of modular forms and quadratic forms. The fundamental result is the weighted representation measure of Siegel. Again, as far as numbers integrally represented, the books of Jones, Watson, and Cassels are most helpful. I'm also including the Lattice website, although the emphasis there is classifying interesting lattices (positive forms) rather than finding the numbers represented (squared norms, often just called norms). I've included SPLAG and Ebeling, again I do not mainly use the lattice viewpoint, but there you go.  
Carl Ludwig Siegel
Lectures on the Analytical Theory of Quadratic Forms (Second Term 1934/35) 
Leonard Eugene Dickson
Studies in the Theory of Numbers (1930)
Modern Elementary Theory of Numbers (1939)
Burton Wadsworth Jones
The Arithmetic Theory of Quadratic Forms (1950)
George Leo Watson 
Integral Quadratic Forms (1960) 
John William Scott Cassels 
Rational Quadratic Forms (1978) 
Jean-Pierre Serre
A Course in Arithmetic  (English translation 1973) 
John Horton Conway 
The Sensual Quadratic Form (1997)
Sphere Packings, Lattices and Groups (1988, with Neil J.A. Sloane)
Wolfgang Ebeling
Lattices and Codes (2nd, 2002)
Gordon L. Nipp
Quaternary Quadratic Forms (1991)
O. Timothy O'Meara
Introduction to Quadratic Forms (1963)
Yoshiyuki Kitaoka 
Arithmetic of Quadratic Forms (1993) 
Larry J. Gerstein
Basic Quadratic Forms (2008)  
http://arxiv.org/find/math/1/au:+Jagy_W/0/1/0/all/0/1 
http://www.math.rwth-aachen.de/~Gabriele.Nebe/LATTICES/ 
There are also some excellent, influential  books by Lam. I sometimes ask him questions, the response is typically that he does not do forms over rings. So, among many threads that might be called quadratic forms, I put Lam in with the name Pfister. Again, I recently got involved with the lattice viewpoint, see SPLAG and Ebeling. The trick there is that it is possible to relate ideas such as covering radius to class number. This relationship is so easy that there really ought to be a short article on "here is how you do this, which you would never know by surveying the literature." But the entire matter is dismissed in a single paragraph on page 378 of SPLAG. When asking for help, I told Richard Borcherds that I sometimes wanted to write a book Here's how YOU can do quadratic forms, and he agreed that one can do a good deal with very little machinery.