There are several questions in the Euler-Goldbach correspondence that
I am unable to answer. Sometimes it does not take very much: in his 
letter to Goldbach dated June 9th, 1750, Euler conjectured 
that every odd number can be written as a sum of four squares
in such a way that $n = a^2 + b^2 + c^2 + d^2$ and $a+b+c+d = 1$.
I was just about to post this to MO when I saw that Euler's conjecture
can be reduced to the Three-Squares Theorem in one line (am I supposed to 
spoil this right away?). Here's another one where I haven't found a proof yet.


In his letter to Goldbach dated Apr.15, 1747, Euler wrote:


*The theorem `Any number can be split into four squares'' depends 
on this:`Any number of the form $4m+2$ can always be split into 
two parts such as $4x+1$ and $4y+1$, none of which has any divisor 
of the form $4p-1$'' (which does not appear difficult, although I 
cannot yet prove it).* 


Later, Euler attributed to Goldbach the much stronger claim that
the two summands can be chosen to be prime, which is a strong form
of the Goldbach conjecture.


Euler's intention was proving the Four-Squares Theorem (which he
[almost 
did](http://www.rzuser.uni-heidelberg.de/~hb3/publ/eu4-2.pdf). Assuming this result, write 
$4m+2 = a^2+b^2+c^2+d^2$; then congruences modulo $8$ show that 
two numbers on the right hand side, say $a$ and $b$, are even, and 
the other two are odd. Now $a^2 + c^2 = 4x+1$ and $b^2 + d^2 = 4y+1$ 
satisfy Euler's conditions except when $a$ and $c$ (or $b$ and $d$) 
have a common prime factor of the form $4n-1$. 
Can this be excluded somehow?


Hermite [Oeuvres I, p. 259] considered a similar problem: 


*Tout nombre impair est decomposable en quatre carres et,
parmi ces decompositions, il en existe toujours de telles
que la somme de deux carrees soit sans diviseurs communs
avec la somme de deux autres.*
(Every odd number can be decomposed into four squares, and 
among these decompositions, there always exist some for which 
the sum of two squares is coprime to the sum of the other two.)


Hermite's proof contains a gap. Can Hermite's claim be proved somehow?



Euler and the Four-Squares Theorem
We address the problem of Euler, showing an asymptotic lower bound for the 
number of ways of writing $n\equiv 2 \pmod 4$ as a sum of four squares $a^2+b^2+c^2+d^2$ 
where neither $a^2+b^2$ nor $c^2+d^2$ is divisible by any prime $\equiv 3 \pmod 4$. For simplicity 
we shall only count the solutions where $a^2+b^2\equiv c^2+d^2 \equiv 1\pmod 4$. 


Let $r(n)$ denote the 
number of ways of writing $n$ as a sum of two squares so that $r(n) = 4 \sum\_{d|n} \chi\_{-4}(d)$ with 
$\chi\_{-4}$ being the non-trivial character $\pmod 4$. Clearly the 
number of solutions we want is at least 
$$ 
\sum\_{\substack{{a+b=n} \\ {a\equiv b\equiv 1 \pmod 4}}} r(a)r(b) - 
2 \sum\_{p\equiv 3 \pmod 4} \sum\_{\substack{{a+b=n} \\ {a\equiv b\equiv 1\pmod 4} \\ {p^2 |a} }} r(a) r(b) = S-2T, 
$$ 
say. (The first sum counts all possible solutions with $a\equiv b\equiv 1 \pmod 4$ and the second sum 
excludes all solutions with either $a$ or $b$ being divisible by the square of sum prime $\equiv 3 \pmod 4$, 
and by symmetry we may assume that $a$ is the one divisible by $p^2$.) 


Let us focus just on evaluating the sum $T$; the sum $S$ is simpler and may be handled similarly. Write 
the sum $T$ as $\sum\_{p \equiv 3 \pmod 4} T(p)$, so that (since $r(ap^2)=r(a)$)  

$$ 
T(p) = \sum\_{\substack{ {a p^2 +b =n} \\ {a\equiv b\equiv 1\pmod 4}}} r(a) r(b).
$$ 
Since $r(k)\ll k^{\epsilon}$ for all $k$, clearly $T(p) \ll n^{1+\epsilon}/p^2$, so that large primes $p$ 
contribute a negligible amount. Now let us suppose that $p$ is small.  

Now if $a\equiv 1 \pmod 4$ we have 
$$ 
r(a) = 4\sum\_{k\ell =a} \chi\_{-4}(a) = 8\sum\_{\substack{ {k|a} \\ {k\le \sqrt{a} } }}^{\prime} \chi\_{-4}(k),
$$ 
using that $\chi\_{-4}(k)=\chi\_{-4}(\ell)$ (because $k\ell\equiv 1\pmod 4$), and the prime 
over the sum indicates that the term $k=\sqrt{a}$ is counted with weight $1/2$.  

Therefore 
$$ 
T(p) =8 \sum\_{k}^{\prime} \chi\_{-4}(k) \sum\_{\substack{{b=n-p^2 k \ell} \\ {b\equiv 1\pmod 4} \\ {\ell \ge k}} } r(b). 
$$ 
Now the sum over $b$ above is just a sum over values $b$ that are at most $n-p^2 k^2$ and 
satisfying the congruence conditions $b\equiv 1\pmod 4$ and $b\equiv n \pmod{p^2k}$.  

In other words, this is a problem of understanding the distribution of the sums of two squares 
function in arithmetic progressions. 


**Sums of two squares in arithmetic progressions.** Let us quickly recall what is known about this problem. Let $R(x;q,a)$ be the sum of $r(n)$ 
over all $n\le x$ with $n\equiv a \pmod q$. The key result we need is that there is a 
good asymptotic formula for $R(x;q,a)$ uniformly for $q$ up to $x^{2/3-\epsilon}$. This 
is due to Selberg and Hooley (unpublished), with details first appearing in a paper of R. A. Smith. 
For a recent nice version see Tolev's paper in Proc. Steklov Inst. (2012, vol 276, 261--274), whose version we shall use. Let $\eta\_a(q)$ denote the number of solutions to the congruence $x^2+y^2 \equiv a \pmod q$ 
with $1\le x, y \le q$. Then 
$$ 
\sum\_{\substack{ {n\le x} \\ {n\equiv a\pmod q}} } r(n) = \pi \frac{\eta\_a(q)}{q^2} x + O((q^{\frac 12} + x^{\frac 13}) (a,q)^{\frac 12} x^{\epsilon}). 
$$
Note that this bound uses the Weil bound for Kloosterman sums; but for our 
application we need only a bound that permits $q$ a little larger than $\sqrt{x}$, and 
less precise elementary estimates for Kloosterman sums would suffice for this. 


**On the function $\eta\_a(q)$.** Note also that 
$\eta\_a(q)$ is a multiplicative function of $q$, and is always $\ll q d(q)$ (where $d(q)$ is the number 
of divisors of $q$). In fact it is not hard to compute what $\eta\_a(q)$ is, and as we shall need this below we summarize this calculation. If $p$ is an odd prime not dividing $a$ then we may show that 
$\eta\_a(p^{k}) = p^{k-1} (p-\chi\_{-4}(p))$. If $p$ is an odd prime that does divide $a$, then 
to compute $\eta\_a(p^k)$ we classify the solutions to $x^2+y^2 \equiv a \pmod {p^k}$ as non-singular 
if $p$ doesn't divide one of $x$ or $y$ and singular otherwise. The non-singular solutions are 
seen to number $2p^{k-1}(p-1)$ if $p\equiv 1\pmod 4$ and $0$ if $p\equiv 3 \pmod 4$. As for the singular solutions, if $k=1$ then this number is just $1$; if $k\ge 2$ and $p^2 \nmid a$ there 
are no singular solutions; and if $k\ge 2$ and $p^2|a$ then the number of singular solutions is 
$p^2 \eta\_{a/p^2}(p^{k-2})$. This describes fully how to compute $\eta\_a(q)$. From this description and 
some calculation we find that 
$$ 
\sum\_{k=1}^{\infty} \chi\_{-4}(k) \frac{\eta\_a(k)}{k^{1+s}} = \frac{L(s,\chi\_{-4})}{\zeta\_2(s+1)} {\tilde \sigma}\_s(n)
$$ 
where $\zeta\_2(s) = \zeta(s) (1-2^{-s})$ (the Euler factor at $2$ removed), and 
$$
{\tilde \sigma}\_s(n) = \sum\_{\substack{{d|n}\\ {d \text{ odd}} } } d^{-s}.
$$  

Given a prime $p\equiv 3 \pmod 4$, for our work on $T(p)$ we shall also need to understand 
the following related Dirichlet series: 
$$ 
\sum\_{k=1}^{\infty} \chi\_{-4}(k) \frac{\eta\_a(kp^2)}{k^{1+s}} 
$$ 
and by a similar calculation we see that if $p\nmid a$ this equals 
$$ 
p(p+1)\Big(1-\frac{1}{p^{s+1}}\Big)^{-1} \frac{L(s,\chi\_{-4})}{\zeta\_2(s+1)} {\tilde \sigma}\_s(n); 
$$ 
and if $p|a$ but $p^2\nmid a$ it is zero; and if $p^2|a$ it equals 
$$ 
p^2 \frac{L(s,\chi\_{-4})}{\zeta\_2(s+1)} {\tilde \sigma}\_s(n/p^2) .
$$ 


**Back to $T(p)$.** We now use the asymptotic formula above in our expression for $T(p)$. Since $\eta\_1(4) = 8$ we 
 obtain that 
 $$ 
 T(p) = 4\pi \sum\_{k \le \sqrt{n}/p} \chi\_{-4}(k) \Big( \frac{\eta\_n(p^2k)}{p^4 k^2} (n-p^2k^2) + O\Big((p\sqrt{k} +n^{\frac 13})
 (n,p^2k)^{\frac 12} n^{\epsilon}\Big)\Big).
 $$
 There are three cases: either $p\nmid n$, $p|n$ but $p^2\nmid n$, and $p^2|n$. 


Consider the first case when $p\nmid n$. Here the error terms 
may be bounded easily as 
$$ 
O\Big( \frac{n^{\frac 56+\epsilon}}{p} + \frac{n^{\frac 34+\epsilon}}{\sqrt{p}}\Big). 
$$ 
Now consider the main term which is 
$$ 
4\pi \frac{n}{p^4} \sum\_{k\le \sqrt{n}/p} \chi\_{-4}(k) \frac{\eta\_n(p^2k)}{k^2} \Big(1 - \frac{p^2k^2}{n}\Big). 
$$ 
We can express this as a contour integral (for some suitably large $c$) 
$$ 
4\pi \frac{n}{p^4} \frac{1}{2\pi i} \int\_{c-i\infty}^{c+i\infty} \Big(\sum\_{k=1}^{\infty} \chi\_{-4}(k) \frac{\eta\_n(p^2k)}{k^{2+s}}\Big) \Big( \frac{\sqrt{n}}{p}\Big)^s \frac{2}{s(s+2)}ds.
$$
Using our knowledge of the Dirichlet series above, we get that the above is 
$$ 
4\pi \frac{n}{p^4} \frac{1}{2\pi i} \int\_{c-i\infty}^{c+i\infty} p (p+1) \Big(1-\frac{1}{p^{2+s}}\Big)^{-1} 
\frac{L(1+s,\chi\_{-4})}{\zeta\_2(s+2)} {\tilde \sigma}\_{1+s}(n) \Big(\frac{\sqrt{n}}{p}\Big)^s \frac{2}{s(s+2)} ds.
$$ 
Now moving the line of integration to Re$(s)=-1+\epsilon$ we obtain that the above is 
$$ 
4\pi \frac{n}{p^4} \Big( p(p+1) \Big(1-\frac{1}{p^2}\Big)^{-1} \frac{L(1,\chi\_{-4})}{\zeta\_2(2)} 
{\tilde \sigma}\_1(n) + O\Big( p^3 n^{-\frac 12+\epsilon}\Big) \Big). 
$$ 
Since $L(1,\chi\_{-4}) =\pi/4$ and $\zeta\_2(2) = \pi^2/8$ the above is 
$$
8 \frac{n}{p^2} \Big(1-\frac{1}{p}\Big)^{-1} {\tilde \sigma}\_1(n) + O\Big( \frac{n^{\frac 12+\epsilon}}{p}\Big). 
$$ 
Thus in this case we find that 
$$ 
T(p) = 8\frac{n}{p^2} \Big(1-\frac{1}{p}\Big)^{-1} {\tilde \sigma}\_1(n) + O\Big( \frac{n^{\frac 56+\epsilon}}{p} 
+ \frac{n^{\frac 34+\epsilon}}{\sqrt{p}} \Big). 
$$ 
 Recall also that $T(p) \ll n^{1+\epsilon}/p^2$ which is useful if $p$ is very large. 


In the second case when $p|n$ but $p^2\nmid n$, trivially $T(p)=0$. 


Finally if $p^2|n$ then we carry out a similar argument to the one above. This gives 
 $$ 
 T(p) = 8\frac{n}{p^2} {\tilde \sigma}\_1(n/p^2) + O \Big(n^{\frac 56+\epsilon} +\sqrt{p} n^{\frac 34+\epsilon} \Big). 
 $$ 
 Once again $T(p)\ll n^{1+\epsilon}/p^2$ which is useful for large $p$. 


Putting all our work above, and splitting into the cases $p\le n^{1/6}$ (where we use 
 our asymptotic formula) and $p>n^{1/6}$ (where we use the trivial bound $\ll n^{1+\epsilon}/p^2$) 
 we obtain that 
 $$ 
 T(p) = 8n {\tilde \sigma}\_1(n) \sum\_{\substack{{p\equiv 3 \pmod 4} \\ {p\nmid n}}} \frac{1}{p(p-1)} 
 + 8n \sum\_{\substack{{p\equiv 3 \pmod 4} \\ {p^2 |n}}} \frac{1}{p^2} {\tilde \sigma}\_1(n/p^2) 
 +O(n^{\frac 56+\epsilon}).
 $$ 


**Conclusion.** In the same way, we find that 
 $$ 
 S = 8n {\tilde \sigma}\_1(n) + O(n^{\frac 56+\epsilon}).
 $$ 
 It follows that the number of solutions to Euler's question is at least 
 $$ 
 S-2T \ge 8n {\tilde \sigma}\_1(n) \Big( 1- \sum\_{p\equiv 3 \pmod 4} \frac{2}{p(p-1)}\Big) + O(n^{\frac 56+\epsilon}) 
 \ge 4n {\tilde \sigma}\_1(n) + O(n^{\frac 56+\epsilon}). 
 $$ 


**Remarks.** With more work one can establish an asymptotic in Euler's problem rather than just the 
 lower bound. Similarly one can give an asymptotic in Hermite's problem. In principle one can make 
 all the error terms explicit, and possibly obtain a complete result for all $n$, but this would entail a lot of work.  

 Lastly in connection with Hermite's problem, a classical problem of Hardy and Littlewood asks for the representations of numbers as $p+x^2+y^2$ with $p$ a prime. This was resolved by Hooley on GRH, and Linnik unconditionally. Once the Bombieri-Vinogradov theorem became available, the result became much simpler.  

 This could be modified to give a stronger version of Hermite's problem for large $n$, by also asking for $p$ to be 
 $1\pmod 4$ -- a cross between Hermite and Goldbach. 


