# Write $n\not\equiv0\pmod 8$ as $w^2+\left(\frac{x(x+1)}2\right)^2+\left(\frac{y(3y+1)}2\right)^2+\left(\frac{z(5z+1)}2\right)^2$

Lagrange's four-square theorem asserts that each $$n\in\mathbb N=\{0,1,2,\ldots\}$$ is the sum of four integer squares. This nice result is actually very weak, for example, it is a consequence of the Gauss-Legendre theorem on sums of three squares. As $$4(w^2+x^2+y^2+z^2)=(2w)^2+(2x)^2+(2y)^2+(2z)^2,$$ Lagrange's four-square theorem is equivalent to that any positive integer not divisible by $$4$$ can be written as the sum of four squares.

Here I propose a new refinement of Lagrange's four-square theorem.

QUESTION 1. Is my following conjecture true?

Big 1-3-5 Conjecture. Any positive integer $$n\not\equiv0\pmod8$$ can be written as $$w^2+\left(\frac{x(x+1)}2\right)^2+\left(\frac{y(3y+1)}2\right)^2+\left(\frac{z(5z+1)}2\right)^2,$$ where $$w$$ is a positive integer and $$x,y,z$$ are integers.

I have verified this for $$n$$ up to $$2\times10^7$$. For example, $$28$$ has a unique required representation: $$28=3^2+\left(\frac {2(2+1)}2\right)^2+\left(\frac{(-1)(3\times(-1)+1)}2\right)^2+\left(\frac{1(5\times1+1)}2\right)^2.$$ See also http://oeis.org/A306614 for related data and similar conjectures.

Note that the Big 1-3-5 Conjecture is different from my 1-3-5 conjecture published in this paper which states that any $$n\in\mathbb N$$ can be written as $$x^2+y^2+z^2+w^2$$ with $$x,y,z,w\in\mathbb N$$ such that $$x+3y+5z$$ is a square. We should also not confuse it with my little 1-3-5 conjecture (cf. http://oeis.org/A287616) which states that any $$n\in\mathbb N$$ can be written as $$x(x+1)/2+y(3y+1)/2+z(5z+1)/2$$ with $$x,y,z\in\mathbb N$$.

The standard algorithm to express $$n\in\mathbb N$$ as $$w^2+x^2+y^2+z^2$$ with explicit $$w,x,y,z\in\mathbb N$$ is as follows: Find $$0\le x\le\sqrt n$$, $$0\le y\le\sqrt{n-x^2}$$ and $$0\le z\le\sqrt{n-x^2-y^2}$$ with $$n-x^2-y^2-z^2$$ a square. Under the Big 1-3-5 Conjecture, we have a better algorithm: For $$n\not\equiv0\pmod 8$$, find $$\begin{gather}x\in\mathbb N\ \text{with}\ x(x+1)/2\le\sqrt n, \\y\in\mathbb Z\ \ \text{with}\ \frac{y(3y+1)}2\le\sqrt{n-\left(\frac{x(x+1)}2\right)^2} \\z\in\mathbb Z\ \ \text{with}\ \frac{z(5z+1)}2\le\sqrt{n-\left(\frac{x(x+1)}2\right)^2-\left(\frac{y(3y+1)}2\right)^2} \end{gather}$$ such that $$n-(x(x+1)/2)^2-(y(3y+1)/2)^2-(z(5z+1)/2)^2$$ is a square.

QUESTION 2. Is there an algorithm to represent an arbitrary positive integer as the sum of four squares which is more efficient than the use of the Big 1-3-5 Conjecture?

The Big 1-3-5 Conjecture is much stronger than Lagrange's four-square theorem. Your comments or further check are welcome!

• Another conjecture that is obvious based on probabilistic considerations and the circle method, and hopeless as far as proofs go. I am curious to hear what you think we learn from these conjectures. Obviously one can make precise versions of these based on the circle method. Equally obviously such conjectures are hopeless based on current technology. What more can one be expected to say? – Lucia Mar 8 at 3:41
• Note that my second question asks whether there is a better algorithm to write $n\in\mathbb N$ as a sum of four squares explicitly. – Zhi-Wei Sun Mar 8 at 5:57
• How is your conjecture an algorithm? It doesn't give $w,x,y,z$ as functions of $n$... – Yaakov Baruch Mar 8 at 8:36
• @Yaakov Baruch I have edited the posting by adding some explanations for algorithms. – Zhi-Wei Sun Mar 8 at 10:36
• This is an awfully bad algorithm, it basically just says "try out $x,y,z$ by trial and error until one works", and your conjecture barely helps with that - the search space is still on the order of that $n^{3/4}$. If you wish to consider algorithms which are even remotely efficient, check out e.g. this discussion on Math.SE. – Wojowu Mar 8 at 11:14