Primes and $x^2+2y^2+4z^2$ A few months ago, I have asked a question about primes represented by ternary quadratic forms. I got two wonderful answers, which showed me how the theory was way richer and more complex that I naively expected from the case of binary forms. I
 was also given a lot of references
to read. They were interesting but unfortunately I got submerged by the amount of theory to learn and by other things to do, and I still don't have a clear overview of how the theory works.
I hope it is not abusing the patience of the readers of this site, and in particular of the experts in that theory, to come back again with a new question, this time 
by stating a very specific result that I have obtained as a by-product of some study of modular forms, and to ask
whether this theorem can be proved using the general theory of ternary quadratic forms (which I very much believe), and if it can, how?

Proposition : a prime $p$ is represented an odd number of times by the form $x^2+2y^2+4z^2$,
  with $x,y,z$ odd positive integers, if and only if $p \equiv 7 \pmod{16}$

I hope the answer will lead me to the part of this large theory I need to learn to understand better this kind of questions (I have (infinitely) many results of the above type, and I'd like to understand how they fit in the general theory) . Also, if someone finds an elementary argument for proving the proposition, I'd be quite interested too. 
 A: Here's a simpler argument. We may assume p is 7 mod 8. Let N be the number of triples of squares (r,s,u) with r+2s+4u=p. We will show that N is odd if p is 7 mod 16 and even if p is 15 mod 16. Let M be (1/64)(the number of representations of p by xx+yy+zz+tt). Jacobi's 4 square theorem (which has elementary proofs using quaternions for example) shows that M=(p+1)/8. So it suffices to show that M and N have the same parity. Now if p=xx+yy+zz+tt, then just one of x,y,z,t is even. So M=(1/16)(the number of representations of p by xx+yy+zz+4tt). In other words, M is the number of ordered quadruples of squares (r,s,t,u) with r+s+t+4u=p. Now the involution (r,s,t,u)-->(r,t,s,u) on this set of quadruples has the N fixed points (r,s,s,u), giving the result.
A: You are doing something unusual here. Taking a diagonal form and insisting on the variables being nonnegative is possible but is not really natural. One counts a representation with some $x$ as distinct from the same representation with $-x.$ 
However, this is what you did. I can fill in the beginning of the story, enough for those expert in quadratic fields to finish it. First, for all odd numbers $n,$ the number of primitive representations with $\pm$ being considered distinct is $h(-32n),$ being the class number of positive binary quadratic forms of the same discriminant has $f(x,y) = x^2 + 8ny^2.$   
Now, there is typically no reason for the number of representations, or number of primitive representations, by a diagonal ternary form $a x^2 + b y^2 + c z^2$ to be divisible by 8. However, once we restrict $n \equiv 7 \pmod 8,$ we immediately find that $x,y,z$ are odd. Odd means nonzero. Furthermore, $1,2,4$ are distinct. So there is no permutation of a given $x,y,z$ that gives the same value. As a result, each triple has exactly eight full versions with the possible $\pm$ on each of three positions. 
So far, with your positive variables, the number of primitive representations is $$h(-32n)/8.$$ 
Alright, you wanted primes. So primitive representations agree with representations. The other effect is that the number of genera of (positive binary forms of) discriminant $-32p$ is four.  
Finally we get to distinguish $7 \pmod {16}$ and $15 \pmod {16}.$ When $p \equiv 15 \pmod {16},$ the number of classes in the principal genus is divisible by 4, because the number of fourth powers in the class group is even. For a given $p \equiv 15 \pmod {16},$ the fourth powers include $\langle 1,0, 8p \rangle$ and $\langle 8,8, p+2 \rangle$ and add up to an even number of classes, should there be any others. For a given $p \equiv 7 \pmod {16},$ the fourth powers include $\langle 1,0, 8p \rangle$ (but not the other one, it is a square but not a fourth power) and add up to an odd number of classes, should there be any others. Put those together, the principal genus has either a multiple of four classes or twice an odd number, multiply by four genera and you get either a multiple of sixteen or $8 \pmod {16},$ finally divide by 8 and you get either an even number or an odd number.  
Probably enough. Relating primitive representations by ternaries (of numbers relatively prime to the discriminant) to a class number goes back to Gauss and the Disquisitiones. As David pointed out, Joel had actually required that $x,y,z$ be odd, so primes $1,3,5 \pmod 8$ are simply not represented in the requested manner. If we remove the oddness restriction, we still get $h(-32p),$ and $x$ must still be odd, but either $y$ or $z$ will be $0$ in some representations, meaning we lose the strict eight to one ratio of representations to nonnegative representations.  
Bonus paragraph: the group of fourth powers is a subgroup of the principal genus, for positive binary forms. Sometimes it coincides with the squares, sometimes it is  smaller. Here it is a subgroup of index two. The reason for my interest is an article of Estes and Pall, in which they show that the spinor kernel is precisely the fourth powers, two binary forms of the same discriminant are in the same genus if their ratio is a square, and in the same spinor genus if their ratio is a fourth power in the class group. If we take the principal form  $x^2 + ny^2,$ then a form in the principal genus that is not a fourth power, then add some $k n^2 z^2,$ if there are no 2-adic problems the resulting ternary forms are in the same genus but distinct spinor genera. So this is a source of interesting examples.
NOTE: by a few trivial lines, the condition I am referring to as "a fourth power in the class group" is the same as "the square of a form that is in a genus containing an ambiguous form." For our discriminant, the two ambiguous forms mentioned occur in the principal genus, and two others, $\langle 4,4, 2p +1 \rangle$ and $\langle 8,0, p \rangle$ are together in a second genus. There are two genera without ambiguous forms. This is from Dennis Estes and Gordon Pall,   Spinor Genera of Binary Quadratic Forms, Journal of Number Theory, vol. 5 (1973), pages 421-432. 
Furthermore, it should be noted that the four genera are separated quite easily by the odd values they represent modulo 8. It's traditional. The principal genus represents only $1 \pmod 8,$ as in the displayed values $1,p+2.$ The other genus containing ambiguous forms represents only $7 \pmod 8,$ as in $p, 2p+1.$ One of the genera without ambiguous forms represents only $3 \pmod 8,$ the other only $5 \pmod 8.$ So there.
