7

Recently on MSE's chat, user "Simd" raised the following problem (I have rephrased and introduced some notation):

For $n \geq 1$ let $S_n \subseteq \mathbb{R}^2$ denote the Cartesian product of $\{0,1,2,\dots,n\}$ with itself, and let $\|\cdot\|$ denote the usual Euclidean distance on $\mathbb{R}^2$. Define $m_n$ to be the smallest positive element of $\{\|a\|-\|b\|: a, b \in S_n\}$, and define $B_n := \{a \in S^n: \text{there is $b \in S^n$ with $|\|a\| - \|b\|| = m_n$}\}$. Identify the sequences $m_n$ and $B_n$ in more concrete terms.

This problem has a geometric interpretation: drawing all circles in $\mathbb{R}^2$ with center $0$ that pass through points of $S_n$, the number $m_n$ is the smallest distance between two distinct such circles, and $B_n$ is the set of all points in $S_n$ that are in one of a pair of circles that realizes this smallest distance. (Before the chat moved on to other things, it was only observed that $m_n \to 0$, as is also shown below). My question is a more focused version of this problem:

Is it true that for all $n \geq 1$ the minimizer $m_n$ is always realized by $a$ and $b$ in $S_n$ that satisfy $|\|a\|^2 - \|b\|^2| = 1$? If not, what is a counterexample?

In view of the elementary character of my attempts below, this seems like it ought to be very close to the surface if it is true; I just haven't been able to prove it. (I have checked it for small $n$ and notwithstanding any bugs in my code it appears to be true at least for $1 \leq n \leq 100$.) If the solution is somehow trivial, I would be interested in seeing whether such solution generalizes to the analogue of $S_n$ in $\mathbb{R}^d$ when $d > 1$ or to more general lattice "shapes" in $\mathbb{R}^2$.

As context for this condition $|\|a\|^2-\|b\|^2| = 1$, and for some consequences of the above statement being true, consider the following.

For any $a$ and $b$ in $S_n$ with $\|a\| \neq \|b\|$ we have \begin{align*} n |\|a\|-\|b\|| & = n \frac{|\|a\|^2-\|b\|^2|}{\|a\| + \|b\|} & \text{difference of squares identity ($a$ and $b$ are not both $0$)} \\ & \geq n \frac{1}{\|a\| + \|b\|} & \text{$\|a\|^2$, $\|b\|^2$ are distinct integers} \\ & \geq n \frac{1}{\sqrt{2n^2} + \sqrt{2n^2}} & \text{$y \in S_n$ implies $\|y\| \leq \sqrt{n^2+n^2}$} \\ & = \frac{1}{2 \sqrt{2}}, \end{align*} and thus $n m_n \geq \frac{1}{2 \sqrt{2}}$. (Equality never holds in $n m_n \geq \frac{1}{\sqrt{2}}$ because the second inequality in the above chain is equality iff $\|a\|=\|b\| = \sqrt{2n^2}$, which cannot happen as $\|a\| \neq \|b\|$.)

The above illustrates how pairs $(a,b)$ that attain $m_n$ (whatever it is) must balance two considerations: the numerator of the first right hand side in the chain above is as small as possible when $|\|a\|^2-\|b\|^2| = 1$ is as small as possible, while the denominator of that fraction is as large as possible when $\|a\|$ and $\|b\|$ (values that one would expect to be approximately the same when $|\|a\|-\|b\||$ is minimized) are as large as possible (within $S_n$). The tension between these goals in $S_n$ is illustrated by the "upper left corner" sequence $a_n = (0,n)$ and $b_n=(1,n)$ (clearly minimizing the numerator) and the "upper right corner" sequence $c_n = (n-1,n)$ and $d_n = (n,n)$ (clearly maximizing the denominator). Short calculations show that $\lim_{n \to \infty} n |\|a_n\| - \|b_n\|| \to \frac{1}{2}$, which implies that $\limsup_{n \to \infty} n m_n \leq \frac{1}{2}$ (and hence $m_n \to 0$ as mentioned above), while $n |\|c_n\| - \|d_n\|| \sim \frac{n}{\sqrt{2}}$ is not even bounded. Neither sequence comes close to the lower bound $\frac{1}{2 \sqrt{2}}$ (and I can show that $\liminf_{n \to \infty} n m_n = \frac{1}{2 \sqrt{2}}$, see below). But my intuition suggests that at least when $n$ is large, there ought to be enough "room" in $S_n$ to get the best of both worlds: to have both $\|a\|$ and $\|b\|$ be, if not exactly as large as the maximum $\sqrt{2n^2}$, at least close enough to that, while satisfying $|\|a\|-\|b\|| = 1$ on the nose.

If we let $\sigma(n) := \{\|a\|^2: a \in S_n\}$ and $M_n := \max \{k \in \sigma(n): k+1 \in \sigma(n)\}$, it is easy to show that the minimum of $|\|a\| - \|b\||$ over all $a, b \in S_n$ that satisfy $|\|a\|^2 - \|b\|^2| = 1$ is $1/(\sqrt{M_n} + \sqrt{M_n + 1})$. If the answer to our question above is in the affirmative, then, we have a reasonably "explicit" formula $$ m_n \overset{?}{=} \frac{1}{\sqrt{M_n} + \sqrt{M_n + 1}}, \qquad n \geq 1, $$ and the set $B_n$ is the intersection of $S_n$ with the union of two circles, having center $0$ and radii $\sqrt{M_n}$ and $\sqrt{M_n + 1}$ respectively. I note that irrespective of the answer to our question, the sequence $M_n$ is a sequence of positive integers that does not appear to be on the OEIS. The nearest misses are A140612 (the $k$ for which $k$ and $k+1$ are both sums of two integer squares), of which $M_n$ is a proper subsequence, and A355769 (the $k$ for which $k$ and $k+1$ are both sums of two nonzero integer squares), of which $\{M_n: n \geq 4\}$ is a proper subsequence (e.g. $72 = 6^2 + 6^2$ is in A355769 but is not a value of $M_n$, whose closest value to $72$ is $M_8 = 73$). I note further in passing that the sequence $M_n$ is not strictly increasing (the first example is $M_{21} = M_{22} = 585$).

To see that $\liminf_{n \to \infty} n m_n = \frac{1}{2 \sqrt{2}}$ we will identify a lot of points in $\{(x_1,x_2,x_3,x_4) \in \mathbb{Z}: x_1^2 + x_2^2 = x_3^2 + x_4^2 + 1\}$. Short calculations show that if integer parameters $r,s,t,p,q$ are fixed, then $(rk-t)^2 + (sk-t)^2 = (rk-p)^2 + (sk-q)^2 + 1$ holds for all integers $k$ if and only if $t(r+s)=rp+sq$ and $p^2 + q^2 = 2t^2+1$. Assuming that such $r,s,t,p,q$ have been found, then the points $a_k := (rk-t,sk-t)$ and $b_k := (rk-p,sk-q)$ satisfy $\|b_k\|^2 = \|a_k\|^2 + 1$, and if $t, p, q$ are nonnegative and $r$ and $s$ are positive, then with $n_k := \max(r,s)k$ we will have both $a_k$ and $b_k$ in $S_{n_k}$ for $k$ sufficiently large. Writing $z_k \sim w_k$ to indicate that $z_k/w_k \to 1$ as $k \to \infty$, short calculations also show that $\|a_k\| \sim k \sqrt{r^2 + s^2}$, that $\|b_k\| \sim k \sqrt{r^2 + s^2}$, and that $n_k |\|a_k\| - \|b_k\|| \to \frac{\max(r,s)}{2 \sqrt{r^2 + s^2}}$ as $k \to \infty$.

Fixing any positive integer $r$ and setting $s := r+1$, $t := r(r+1)$, $p := r^2 - 1$, and $q = (r+1)^2 - 1$, short calculations show that $t(r+s)=rp+sq$ and $p^2 + q^2 = 2t^2+1$, so (per the previous paragraph) there are sequences $a_k$ and $b_k$ and $n_k$ with $a_k$ and $b_k$ in $S_{n_k}$ for all $k$ sufficiently large, and with $n_k |\|a_k\| - \|b_k\|| \to \frac{r+1}{2 \sqrt{r^2 + (r+1)^2}}$ as $k \to \infty$, and we deduce that $\liminf_{n \to \infty} n m_n \leq \frac{r+1}{2 \sqrt{r^2 + (r+1)^2}}$. Since $r$ was arbitrary, we also deduce that $\liminf_{n \to \infty} n m_n \leq \frac{1}{2 \sqrt{2}}$, and in view of the lower bound proved earlier, that $\liminf_{n \to \infty} n m_n = \frac{1}{2 \sqrt{2}}$.

  • I should have said that only that the portions of $M_n$ indicated above were subnets of the "sums of squares" sequences in the OEIS (because $M_n$ is not strictly increasing and can "revisit" terms in those strictly increasing sequences) – leslie townes Mar 15 '24 at 00:12
  • 1
    Now what about $\ell_p$-distance in $\mathbb{R}^m$? :P – Jakobian Mar 15 '24 at 14:52

1 Answers1

4

This is an interesting question; thanks for the detailed exposition of the substantial progress you made on it. I’m a bit surprised that you didn’t find this proof yourself, since you provide all the ingredients and your nice proof of $\liminf_{n\to\infty}nm_n=\frac1{2\sqrt2}$ is much more sophisticated than this. So perhaps I’m overlooking some gap, but this seems to me to be a straightforward proof of your claim:

With your $a_n=(0,n)$ and $b_n=(1,n)$, we have $\|a_n\|^2=n^2$ and $\|b_n\|^2=n^2+1$, so $\|b_n\|^2-\|a_n\|^2=1$. So if $a_n$ and $b_n$ realize $m_n$, we’re done. If not, some $u$ and $v$ with $0\lt\|v\|-\|u\|\lt\|b_n\|-\|a_n\|$ realize $m_n$. With

\begin{eqnarray*} \|b_n\|-\|a_n\| &=& \sqrt{n^2+1}-n \\ &=& n\left(\sqrt{1+\frac1{n^2}}-1\right) \\ &\le& n\left(1+\frac1{2n^2}-1\right) \\ &=& \frac1{2n}\;, \end{eqnarray*}

we have

\begin{eqnarray*} \|v\|^2-\|u\|^2 &=& (\|v\|-\|u\|)\,(\|v\|+\|u\|) \\ &\lt& (\|b_n\|-\|a_n\|)\,(\|v\|+\|u\|) \\ &\le& \frac1{2n}\left(\sqrt2n+\sqrt2n\right) \\ &=& \sqrt2\;. \end{eqnarray*}

Since $0\lt\|v\|^2-\|u\|^2\lt\sqrt2$ and $\|v\|^2-\|u\|^2$ is an integer, $\|v\|^2-\|u\|^2=1$ follows as required.

joriki
  • 238,052
  • 2
    Hello. I think $b_n = (0, n + 1)$ is a typo and you meant $(1, n)$? Nice answer though! I agree it's a good question. – Izaak van Dongen Mar 15 '24 at 03:51
  • 2
    Also a cute way to get this bound on $\sqrt{n^2 + 1} - n$ is to "rationalise the numerator" and write it as $(\sqrt{n^2 + 1} + n)^{-1}$. Nothing wrong with your way of course! – Izaak van Dongen Mar 15 '24 at 03:58
  • 1
    @IzaakvanDongen: Thanks – good catch (I fixed that), and nice trick! – joriki Mar 15 '24 at 04:08
  • 1
    Wow, thanks! It did feel like I was missing something (although had I noticed anything like this, I might not have studied the asymptotics at all). Happy Pi day! – leslie townes Mar 15 '24 at 05:31