Bounds on integer solutions to $w^2 - x^2 - y^2 - z^2 = m$

134 Views Asked by At

Consider the space $I(m) \subset \mathbb{Z}^4$ which corresponds to integer $(w, x, y , z)$ that are solutions of$$w^2 - x^2 - y^2 - z^2 = m$$ where $w, x, y, z, m \in \mathbb{Z}^{+}$

Are there any known bounds for space $I(m)$?

For example, if we ignore $y$ and $z$, then the equation $w^2 - x^2 = m$ will have solutions within $\vert w \vert \le m$ and $\vert x \vert \le m$ (because $(w + x) \mid m$ and $(w - x)\mid m$, from now the result easily follows) Unfortunately the technique won't generalize for more variables.

Using a computer it seems that an upper bound on the absolute value $\vert \cdot \vert \le 2m$ looks believable for the variables $w, x, y$ and $z$. Can we prove this? (It seems that from computer experiments, for $m > 1$, even the bound $\vert \cdot \vert \le m$ seems to work; for $m = 1$ there is a non-trivial solution $(2, 1, 1, 1)$)

Motivation: I'm trying to write a computer program to generate such numbers. Having such a bound will mean that I can compute the entire set using simple brute-force algorithm. In my problem there are three more additional constraints: $x + y \le w$, $y + z \le w$ and $x + z \le w$. I've omitted them here to form a simple problem statement.

1

There are 1 best solutions below

3
On BEST ANSWER

You are wrong about the bounds on $m=1.$ For example:

$$5^2-4^2-2^2-2^2=1.$$

You might be correct if you require $\max(x+y,x+z,y+z)\leq w,$ as indicated in your note at the bottom.

There are infinitely many solutions for $m=1$ of the form:

$$(w,x,y,z)=(2y_0^2+2z_0^2+1,2y_0^2+2z_0^2,2y_0,2z_0)$$

Indeed, we can show that there are infinitely many solutions for any $m.$

For example, when $m$ is odd we have the solutions:

$$((w,x,y,z)=\left(2y_0^2+2z_0^2+\frac{m+1}{2},2y_0^2+2z_0^2+\frac{m-1}{2},2y_0,2z_0\right)$$

These are just the solutions where $m$ odd, $w-x=1$ and $y,z$ are both even.

When $m$ is even, then you can get:

$$(w,x,y,z)=\left(1+\frac{m}{2}+2(y_0^2+y_0+z_0^2),\frac{m}{2}+2(y_0^2+y_0+z_0^2),2y_0+1,2z_0\right)$$

These are all solutions when $w-x=1$ and $y$ is odd, $z$ is even.


If $w^2-x^2=M$ then $w-x$ and $w+x=w-x+2x$ must both be the same parity and so either $M$ is odd or $M$ is divisible by $4.$

If $M$ is odd, we can get $w-x=1,w+x=M$ and thus $w=\frac{M+1}{2},x=\frac{M-1}{2}.$

If $M>4$ is divisible by $4$, you can get $w-x=2,w+x=\frac{M}{2}$ or $w=\frac{M}{4}+1,x=\frac{M}{4}-1.$ (If $M=4, we get $x=0, which, as I read the question, is not allowed.)

Now, given any $m$ there are infinitely many $y,z$ such that $M=m+y^2+z^2$ is odd. Namely:

  1. If $m$ is even, we can take exactly one of $y,z$ to be odd, of
  2. If $m$ is odd, we can take $y,z$ to be both odd or both even.

In particular we have infinitely many $w,x,y,z$ for any $m.$

We can also get $m+y^2+z^2$ divisible by four when:

  1. $m\equiv 2\pmod{4}$ and we take both $y,z$ odd,
  2. $m\equiv 0\pmod{4}$ and we take $y,z$ both even,
  3. $m\equiv 3\pmod{4}$ and we take one of $y,z$ odd, the other even

Given any such $y,z$ you get, for $M=m+y^2+z^2$: $\left\lfloor\tau(M)/2\right\rfloor$ pairs $w,x>0$ when $M$ is odd and $\left\lfloor \tau\left(\frac{M}{4}\right)/2\right\rfloor$ when $M$ is divisible by $4.$

Here, $\tau(M)$ is the number of positive factors of $M$.


With condition: $\max(x+y,y+z,x+z)\leq w$

With the additional condition that $\max(x+y,y+z,x+z)\leq w,$ we will assume $0<x\leq y\leq z$ and $y+z\leq w.$

Then $$\begin{align}w^2&=m+x^2+y^2+z^2\\ &=m+x^2+(y+z)^2-2yz\\ &\leq m+y^2+w^2-2yz \end{align}$$ or $$y(2z-y)\leq m$$

In particular, $2z-y=z+(z-y)\geq z$ so we get $yz\leq y(2z-y)\leq m.$ Thus there are only finitely many $y,z$ to check, and specifically you must have $1\leq y\leq z\leq m.$

Im particular, since $x,y,z\leq m$ you have $w^2\leq m+3m^2\leq 4m^2$ with equality only when $m=1.$ So $w\leq 2m$ with equality only possible when $m=1.$ This is your conjecture.

More strongly, if $m\geq 5$ you can get that $w\leq m-1.$

Specifically, when $x\leq y\leq z$ and $y+z\leq w,$ set $k=z-y$ then we know $y(2z-y)=y(2k+y)\leq m$ or $$y^2\leq m-2ky\tag{1}$$

Then $$\begin{align}w^2&=m+x^2+y^2+z^2\\ &\leq m + 2y^2+(y+k)^2\\ &=m+ 3y^2 + 2ky+k^2\\ &\leq 4m + k(k - 4y)\\ &=4m +(z-y)(z-5y) \end{align}$$

Now, the maximum of $(z-y)(z-5y)$ is $(m-1)(m-5)$ for $0<y\leq z\leq m$ and $m\geq 5$ so we have that $$w^2\leq 4m+(m-1)(m-5)=m^2-2m+5=(m-1)^2+4.$$

But when $m>2,$ $(m-1)^2+4<m^2,$ and thus $w\leq m-1$ when $m>5.$

If $m\leq 4$ then $(z-y)(z-5y)\leq 0$ and you get that $w\leq 2\sqrt{m}.$ When $m=2,3,4,$ $m=\lfloor2\sqrt{m}\rfloor$ so $m$ is the maximum in those cases. When $m=1,$ the maximum is $w=2.$

When $m=3,$ $3^2-1^2-1^2-2^2=3.$

When $m=4,$ $4^2-2^2-2^2-2^2=4.$

When $m=2$ there are no solutions.

When $m=5,$ we have $4^2-1^2-1^2-3^2=5$ so we can reach this theoretical maximum $m-1.$