Question: Why do so few $n\equiv 3 \bmod 8$ have an odd number of representations in the form $$n=x\_0^2 + x\_1^2 + \dots + x\_{10}^2$$ with $x\_i \geq 0$?


Note that $x\_i\geq 0$ spoils the symmetry enough that this is not the usual "number of representations as a sum of squares" question. The question may be ill-posed, too: I do not know that there are few such $n$, but computations suggest that their counting function is $\sim cx/\log x$.


The question I'd like to answer is this: which $n$ have an odd number of representations of the form $$n=x\_0^2+2x\_1^2+4x\_2^2+ \dots = \sum\_{i=0}^\infty 2^i x\_i^2,$$ where $x\_i \geq 0$? Does the set of such $n$ have 0 density? The motivation for this question is that it is nontrivially the same as [this question](https://mathoverflow.net/questions/26839/how-thick-is-the-reciprocal-of-the-squares).


If $n$ is even and has an odd number of reps, then (nice exercise) $n$ has the form $2k^2$. If $n\equiv 1\pmod4$ and has an odd number of reps, then (challenging but elementary) $n$ has a special sort of factorization, and there are very few such $n$.


The question I'm asking here is for $n\equiv 3 \bmod 8$. Reducing modulo 8 reveals that $x\_2$ must be even. If it isn't a multiple of 4, then we can pair off the two reps:
 $$(x\_0,x\_1,x\_2,x\_3,x\_4,x\_5,\dots) \leftrightarrow (x\_0,x\_1,2x\_4,x\_3,x\_2/2,x\_5,\dots).$$
If $x\_2$ is a multiple of 4 but not 8, then we can make a similar pairing with $x\_2$ and $x\_5$, and so on. This only leaves the situation when $x\_2$ and $x\_4,x\_5,\dots$ are all zero.


This leaves us at: Which $n\equiv 3\bmod 8$ have an odd number of representations in the form:
 $$n = x\_0^2 + 2x\_1^2 + 8 x\_3^2 \; , \; \; \mbox{with} \; \; x\_0, x\_1, x\_3 \geq 0 \;?$$
Some play with the parities of binomial coefficients reduces this to the question I led with.



Why are there usually an even number of representations as a sum of 11 squares
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) $ be the number of triples $ (a,b,c) \; \mbox{with} \; a,b,c > 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) \; \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.


