MathOverflow will be down for maintenance for approximately 3 hours, starting Monday evening (06/24/2013) at approximately 9:00 PM Eastern time (UTC-4).
show/hide this revision's text 3 blank displayed equations for new paragraphs

Throughout $N>0,$ and $N \equiv 3 \pmod 8.$ Let $I$ be the number of ordered triples $(a,d,e) \;\mbox{with} \; a,d,e \geq 0,$ such that $$a^2+2 d^2+8 e^2=N.$$ I'll use a result of Gauss on sums of 3 squares to show that if there are 3 or more primes whose exponent in the prime factorization of $N$ is odd, then $I$ is even. As a consequence those $N$ for which $I$ is odd form a set of density 0; in fact the number of such $N < x$ for positive real $x$ is $$ O \left( \frac{x \; \log \log x}{\log x} \right). $$
Let $ R=R(N)$ R = R(N) $ be the number of triples $ (a,b,c) (a,b,c) \; with \mbox{with} \; a,b,c > 0$ > 0 $ and
$$ a^2+b^2+c^2=N,$$ and let $r(N)$ be the number of such triples with the $ \gcd(a,b,c) = 1.$ Then $R$ is the sum of
the $r(N/k^2),$ the sum running over all $k>0$ for which $k^2 | N.$ Now in Disquisitiones, Gauss shows that if
$N>3, \mbox{then} \; r(N)/3$ is the number of classes (under proper equivalence) of positive primary binary forms of discriminant $- N.$ (Or if you prefer, the number of classes of invertible ideals in the quadratic order of discriminant $- N$). Now these classes form a group, and Gauss uses genus theory to show that the order of this group is divisible by $2^{M-1}$ where $M$ is the number of primes that divide $N.$ So if 3 or more primes have odd exponent in the prime factorization of $N,$ then all these primes divide $N/k^2,$ the corresponding group has order divisible by $2^{3-1}=4,$ so 4 divides each $r(N/k^2),$ and 4 divides $R.$ $$ $$ Now let $S=S(N)$ be the number of pairs $(a,d) \; with \mbox{with} \; a,d > > 0$ and
$$a^2+2 d^2=N,$$ and $s(N)$ be the number of such pairs with $ \gcd(a,d) = 1.$ Then $S$ is the sum of the $s(N/ k^2).$ Using the fact that $\mathbb{Z} \left[ \sqrt{-2} \right]$ is a UFD we can calculate $s(N/k^2);$ it is zero when some prime $p \equiv 5,7 \pmod 8$ divides $N/k^2.$ When this doesn't happen there are 3 or more
primes $q \equiv 1,3 \pmod 8$ dividing $N/k^2,$ so 4 divides each $s(N/ k^2)$ and 4 divides $S$ as well as $R.$ We conclude the proof by showing that $$2I=R+S.$$

Suppose $N \equiv 3 \pmod 8$ and $a^2+b^2+c^2=N,$ with $a,b,c>0.$ Of course $a,b, c$ are odd. If $b \equiv c \pmod 4,$ let $d=(b+c)/2$ and $e = | (b-c)/4 |.$ Otherwise let $d = | (b-c)/2 |$ and $e=(b+c)/4.$ Then $$a^2+2 d^2+8 e^2=a^2+b^2+c^2=N.$$ Furthermore $(a,b,c)$ and $(a,c,b)$ map to the same $(a,d,e).$ The fiber of the map $(a,b,c) \mapsto (a,d,e)$ has 1 element when $e=0$ and 2 elements otherwise. So $2I=R+S.$ $$ $$ If $N = p q$ where $p$ and $q$ are primes congruent to 5 and 7 $ \pmod 8$
respectively, with $ (q | p ) = -1$ it can be shown that $R \equiv 2 \pmod 4,$ so that $I$ is odd. This should
allow one to get a lower bound for the number of $ N < x $ with $I$ odd that's a constant multiple of the upper
bound mentioned above. But whether the number is asymptotic to a constant multiple of $x \; \log \log(x)/ \log (x)$ as Jagy's calculations suggest isn't clear.

show/hide this revision's text 2 added 1844 characters in body

Throughout N>0 $N>0,$ and is =$N \equiv 3 mod 8. I is \pmod 8.$ Let $I$ be the number of
ordered triples (a,d,e) all non-negative with a^2+2*d^2+8*e^2=N. $(a,d,e) \;\mbox{with} \; a,d,e \geq 0,$ such that$$a^2+2 d^2+8 e^2=N.$$ I'll use a result of Gauss on sums of 3 squares to
show that if there are 3 or more primes whose exponent in the N withI prime
factorization of $N$ is oddhave , then $I$ is even. As a consequence those $N$
which $I$ is odd form a set of density 0.; in fact the number of such $N

  Let R $R=R(N)$ be the number of triples   (a,b,c) all >0 $(a,b,c) \; with a^2+b^2+c^2=N, \; a,b,c > 0$ and  

$$ a^2+b^2+c^2=N,$$ and let r(N) $r(N)$ be the number of suchtriples with the g.c.d $ \gcd(a,b,c) = 1.$ Then $R$ is the sum ofa,b and c=1. In
the $r(N/k^2),$ the sum running over all $k>0$for which $k^2 | N.$ Now in Disquisitiones, Gauss proved shows that ifN>3, r(N)/3
$N>3, \mbox{then} \; r(N)/3$ is the number of classes (underproper equivalence) of positive primitive primary binary forms with of discriminant $- N. As N.$ (Or if you prefer, the number ofclasses of invertible ideals in the quadratic order of discriminant $- N$). Now these classes form a corollary we find--If group, andGauss uses genus theory to show that the square-free part N_0 order of N has this group is
divisible by $2^{M-1}$ where $M$ is thenumber of primes that divide $N.$ So if 3 or more prime factors then 4 divides R. In particular primes have odd
exponent in the set prime factorization of N for which 4 doesn't $N,$then all these primes divide R $N/k^2,$ the corresponding group has density 0. To see this note that genus theory order
divisible by $2^{3-1}=4,$ so 4 divideseach $r(N/k^2),$ and Gauss' result applied to N_0 show that 4 divides r(N_0). $R.$

 Now R let $S=S(N)$ be the number of pairs  $(a,d) \; with \; a,d > 0$  and  

$$a^2+2 d^2=N,$$ and $s(N)$ be the number of such pairswith $ \gcd(a,d) = 1.$ Then $S$ is evidently the sum of the r(M) where N/M and M/N_0 are squares. Furthermore Gauss' result can be used to show $s(N/ k^2).$ Using the fact that r(N_0) $\mathbb{Z} \left[ \sqrt{-2} \right]$ is a UFDwe can calculate $s(N/k^2);$ it is zero when some prime $p \equiv 5,7 \pmod 8$ divides each r(M). So r(N_0) $N/k^2.$ When this doesn't happen there are 3 or more
primes $q \equiv 1,3 \pmod 8$ dividing $N/k^2,$ so 4 divides R each $s(N/ R=0 mod 4 divides $S$ as well as $R.$ We conclude the proof by showing that $$2I=R+S.$$

Suppose $N \equiv 3 \pmod 8$ and $a^2+b^2+c^2=N,$ with $a,b,c>0.$ Of course $a,b, c$ are odd.

Now If $b \equiv c \pmod 4,$ let S be $d=(b+c)/2$ and $e = | (b-c)/4 |.$ Otherwise let $d = | (b-c)/2 |$ and $e=(b+c)/4.$ Then $$a^2+2 d^2+8 e^2=a^2+b^2+c^2=N.$$ Furthermore $(a,b,c)$ and $(a,c,b)$ map to the number same $(a,d,e).$ The fiber of pairs the map $(a,b,c) \mapsto (a,d) both >0 with a^2+2*d^2=Na,d,e)$ has 1 element when $e=0$ and 2 elements otherwise. The So $2I=R+S.$

 If $N = p q$ where $p$ and $q$ are primes congruent to 5 and 7 $ \pmod 8$  

respectively, with non-zero Shave density 0. I claim further $ (q | p ) = -1$ it can beshown that 2I=R+S$R \equiv 2 \pmod 4,$ so that $I$ is odd. The claim and the corollary settle This should
allow one to get a lower bound forthe problem. As I'm running out number of space I'll prove $Nbound mentioned above. Butwhether the claim in a remark number is asymptotic to followa constant multiple of $x \; \log \log(x)/ \log (x)$ as Jagy's calculations suggestisn't clear.

show/hide this revision's text 1

Throughout N>0 and is =3 mod 8. I is the number of triples (a,d,e) all non-negative with a^2+2*d^2+8*e^2=N. I'll use a result of Gauss on sums of 3 squares to show that the N with I odd have density 0.

Let R be the number of triples (a,b,c) all >0 with a^2+b^2+c^2=N, and let r(N) be the number of such triples with the g.c.d of a,b and c=1. In Disquisitiones Gauss proved that if N>3, r(N)/3 is the number of classes of positive primitive binary forms with discriminant -N. As a corollary we find--If the square-free part N_0 of N has 3 or more prime factors then 4 divides R. In particular the set of N for which 4 doesn't divide R has density 0. To see this note that genus theory and Gauss' result applied to N_0 show that 4 divides r(N_0). Now R is evidently the sum of the r(M) where N/M and M/N_0 are squares. Furthermore Gauss' result can be used to show that r(N_0) divides each r(M). So r(N_0) divides R and R=0 mod 4.

Now let S be the number of pairs (a,d) both >0 with a^2+2*d^2=N. The N with non-zero S have density 0. I claim further that 2I=R+S. The claim and the corollary settle the problem. As I'm running out of space I'll prove the claim in a remark to follow.