# Visibility phenomena in hypercubes

Jayadev S. Athreya, Cristian Cobeli, Alexandru Zaharescu  JA: Department of
Mathematics, University of Washington, Padelford Hall, Seattle, WA 98195, USA
<EMAIL_ADDRESS>CC: Simion Stoilow Institute of Mathematics of the Romanian
Academy, P. O. Box 1-764, RO-014700 Bucharest, Romania
<EMAIL_ADDRESS>AZ: Department of Mathematics, University of
Illinois at Urbana-Champaign, Altgeld Hall, 1409 W. Green Street, Urbana, IL,
61801, USA and Simion Stoilow Institute of Mathematics of the Romanian
Academy, P. O. Box 1-764, RO-014700 Bucharest, Romania<EMAIL_ADDRESS>
###### Abstract.

We study the set of visible lattice points in multidimensional hypercubes. The
problems we investigate mix together geometric, probabilistic and number
theoretic tones. For example, we prove that almost all self-visible triangles
with vertices in the lattice of points with integer coordinates in
$\mathcal{W}=[0,N]^{d}$ are almost equilateral having all sides almost equal
to $\sqrt{d}N/\sqrt{6}$, and the sine of the typical angle between rays from
the visual spectra from the origin of $\mathcal{W}$ is, in the limit, equal to
$\sqrt{7}/4$, as $d$ and $N/d$ tend to infinity. We also show that there
exists an interesting number theoretic constant $\Lambda_{d,K}$, which is the
limit probability of the chance that a $K$-polytope with vertices in the
lattice $\mathcal{W}$ has all vertices visible from each other.

###### Key words and phrases:

Hypercube, visible points, polytope, Euclidean distance

###### 2010 Mathematics Subject Classification:

11B99; 11K99; 11P21; 51M20; 52Bxx

##  1\. Introduction

Various phenomena related to distances in high dimensional spaces have
attracted attention recently. For instance Gafni, Iosevich and Wyman [11]
continue the study of the interesting connections with the unit distance
problem in higher dimentions explored in [13, 14, 15, 16, 19]. Problems linked
to the distribution of distances between points in finite sets placed in
metric spaces (particular Euclidean spaces) have been investigated by various
authors from many different perspectives. A selection of such results, by no
means complete, includes the works of general theoretical interest of Bäsel
[3], Baileya, Borwein and Crandall [2], Burgstaller and Pillichshammer [5],
Dunbar [9], Mathai, Moschopoulos and Pederzoli [18].

There are also many practical applications of these problems, in particular in
high-dimensional data analysis. For example, the article of Aggarwal,
Hinneburg and Keim [1] is related to data mining techniques, Li and Qiu [17]
study probabilistic problems related to wireless communication networks,
Srinivasa and Haenggi [21] are interested in wireless networks whose
efficiency is strongly influenced by the nodal distances, while Bubeck and
Sellke [4] prove a universal law of robustness that explains the necessity of
overparametrization in deep neural networks.

In the present paper we study a few aspects related to visible lattice points
in high dimensional hypercubes. Let
$\mathcal{C}:=[0,N]^{d}\subset\mathbb{R}^{d}$ be the $d$ dimensional real cube
of side length $N$, for some integers $d,N\geq 1$. Denote by
$\mathcal{W}:=\mathcal{C}\cap\mathbb{Z}^{d}$ the set of $(N+1)^{d}$ points
with integer coordinates in $\mathcal{C}$. We denote by
$\operatorname{\mathfrak{d}}(\bm{v},\bm{w})$ the Euclidean distance between
any two points $\bm{v}=(v_{1},\dots,v_{d})$ and $\bm{w}=(w_{1},\dots,w_{d})$.

The smallest distance between two points in $\mathcal{W}$ is equal to $1$,
which is always met between two neighbor points, while the largest is attained
by the opposite end points of the longest diagonals. Such points are
$\bm{v}=(0,\dots,0)$ and $\bm{w}=(N,\dots,N)$ and the distance between them is
$\operatorname{\mathfrak{d}}(\bm{v},\bm{w})=\sqrt{d\cdot N^{2}}=Nd^{1/2}$.
Then, it is natural to normalize $\operatorname{\mathfrak{d}}(\bm{v},\bm{w})$
to obtain the normalized Euclidean distance
$\operatorname{\mathfrak{d}}_{d}(\bm{v},\bm{w})$, for which all normalized
distances between points in $\mathcal{W}$ will belong to the interval $[0,1]$.
Thus,

$\operatorname{\mathfrak{d}}_{d}(\bm{v},\bm{w}):=\frac{1}{Nd^{1/2}}\bigg{(}\sum_{n=1}^{d}(w_{n}-v_{n})^{2}\bigg{)}^{1/2}\,$

and

$\operatorname{\mathfrak{d}}(\bm{v},\bm{w})=Nd^{1/2}\operatorname{\mathfrak{d}}_{d}(\bm{v},\bm{w})=\bigg{(}\sum_{n=1}^{d}(w_{n}-v_{n})^{2}\bigg{)}^{1/2}.$

Denote by $\Omega\subset\mathcal{W}\times\mathcal{W}$ the set of pairs of
points that are visible from each other, that is, there are no other lattice
points in $\mathcal{W}$ between them on the straight line segment that joins
them. Then, by definition, $\Omega$ is the set of all pairs
$(\bm{v},\bm{w})\in\mathcal{W}\times\mathcal{W}$ such that

$\gcd(v_{1}-w_{1},\dots,v_{d}-w_{d})=1.$ (1.1)

We show that the normalized distance between almost any two points in
$\mathcal{W}$ that are visible from each other is as close to
$1/\sqrt{6}\approx 0.40825$ as one wishes, if the dimension $d$ is
sufficiently large and $N$ is large enough with respect to $d$.

######  Theorem 1.

For any $\varepsilon>0$, there exists an integer $C(\varepsilon)\geq 3$ such
that for any integers $d\geq C(\varepsilon)$ and $N\geq C(\varepsilon)d$ we
have:

$\frac{1}{\\#\Omega}\cdot\\#\left\\{(\bm{v},\bm{w})\in\Omega\;:\;\operatorname{\mathfrak{d}}_{d}(\bm{v},\bm{w})\in\left[\mbox{\small$\displaystyle\frac{1}{\sqrt{6}}$}-\varepsilon,\mbox{\small$\displaystyle\frac{1}{\sqrt{6}}$}+\varepsilon\right]\right\\}\geq
1-\varepsilon\,.$ (1.2)

As a consequence of Theorem 1 we see that almost all triangles with vertices
visible from each other are almost equilateral, almost all tetrahedrons with
vertices visible from each other are almost regular and so on.

In general, for any $K\geq 2$ let us denote by $\Omega_{K}$ the set of
$K$-polytopes with the property that any two of its vertices are visible from
each other. Said differently, if we call self-visible a $K$-polytope with the
property that from any of its vertices one can see all the others without any
obstruction from any of the lattice points in $\mathcal{W}$, then

$\Omega_{K}:=\\{P=(\bm{v}_{1},\dots,\bm{v}_{d})\in\mathcal{W}^{K}\;:\;P\text{
is self-visible}\\}.$

Then, essentially, Theorem 1 can be restated in the following form, which is,
at the same time, a consequence and a more general form of it.

######  Corollary 1.

Let $K\geq 2$ be a fixed integer. Then, for any $\varepsilon>0$, there exists
an integer $C(K,\varepsilon)\geq 3$, such that for any integers $d\geq
C(K,\varepsilon)$ and $N\geq C(K,\varepsilon)d$, the proportion of polytopes
$P\in\Omega_{K}$ for which

$\operatorname{\mathfrak{d}}_{d}(\bm{w}^{\prime},\bm{w}^{\prime\prime})\in\left[1/\sqrt{6}-\varepsilon,1/\sqrt{6}+\varepsilon\right]$

for all distinct $\bm{w}^{\prime},\bm{w}^{\prime\prime}\in P$ is greater than
$1-\varepsilon$.

The next theorem answers the question of whether there is a limit probability
that a $K$-polytope in $\mathcal{W}^{K}$ is self-visible.

######  Theorem 2.

Let $d\geq 2$, $N\geq 2$ and $2\leq K\leq 2^{d}$ be integers. Then, the
probability that a $K$-polytope is self-visible is

$\frac{\\#\Omega_{K}}{\\#\mathcal{W}^{K}}=\prod_{\begin{subarray}{c}\text{$p$
prime}\end{subarray}}\left(1-\frac{1}{p^{d}}\right)\cdots\left(1-\frac{K-1}{p^{d}}\right)+O\left(\frac{dK}{N^{1/2}}\right)+O\left(\frac{2^{d}K^{2}}{\log^{d-1}N}\right),$
(1.3)

and the implied constants in the big $O$ terms are absolute.

The infinite product over all primes in (1.3) is convergent and defines an
endless square of constants

$\Lambda_{d,K}:=\prod_{\begin{subarray}{c}\text{$p$ prime}\end{subarray}}\
\prod_{k=1}^{K-1}\left(1-\frac{k}{p^{d}}\right),$

which increase with $d$ and decrease with $K$. They comprise some remarkable
numbers for which Theorem 2 gives a probabilistic geometric interpretation.
For instance, if $K=2$, then $\Lambda_{2,2}=1/\zeta(2)=6/\pi^{2}\approx
0.6079271$ and $\Lambda_{d,2}=\zeta(d)^{-1}$ for $d\geq 2$. If $d=2$ and
$K=3$, then

$\Lambda_{2,3}=\frac{6}{\pi^{2}}(2C_{FT}-1)\approx 0.196138,$

where

$C_{FT}:=\frac{1}{2}\left(1+\frac{1}{\zeta(2)}\prod_{p}\left(1-{\frac{1}{p^{2}-1}}\right)\right)\approx
0.661317$

is the Feller-Tornier constant (see Feller and Tornier [10] and sequence
A065493 from OEIS [20]), which is related to the prime zeta function.

Let us note that if $N=0$ then $\mathcal{W}^{K}$ and $\Omega_{K}$ are reduced
to a single point. If $N=1$, all the points in $\mathcal{W}$ are vertices.
Then all points in $\mathcal{W}^{K}$ are self-visible, because there are no
intermediary points in the hypercube’s lattice which blind the view from one
point to another. Then, if $N=1$, $\frac{\\#\Omega_{K}}{\\#\mathcal{W}^{K}}=1$
for $2\leq K\leq 2^{d}$.

We also remark that for any $N>1$, if $K>2^{d}$ then in (1.3) both non-error
terms, the one from the left side and the main term on the right side, are
equal to zero. In this case (1.3) holds true with no error terms.

Let $\vec{\bm{v}}$ denote the ray that starts at the origin
$\mathbf{0}=(0,\dots,0)\in\mathcal{W}$ and passes through
$\bm{v}\in\mathcal{W}$. Denote by $\Psi$ the set of pairs of rays
$(\vec{\bm{v}},\vec{\bm{w}})$ with $(\bm{v},\bm{w})\in\Omega$. The next result
shows that if $d$ and $N/d$ are sufficiently large then almost all angles
between rays from the origin towards points that are visible to each other
have the sine almost equal to $\sqrt{7}/4$.

######  Theorem 3.

For any $\varepsilon>0$, there exists an integer $C(\varepsilon)\geq 3$ such
that for any integers $d\geq C(\varepsilon)$ and $N\geq C(\varepsilon)d$ we
have:

$\frac{1}{\\#\Psi}\cdot\\#\left\\{(\vec{\bm{v}},\vec{\bm{w}})\in\Psi\;:\;\sin\big{(}\widehat{\vec{\bm{v}},\vec{\bm{w}}}\big{)}\in\left[\mbox{\small$\displaystyle\frac{\sqrt{7}}{4}$}-\varepsilon,\mbox{\small$\displaystyle\frac{\sqrt{7}}{4}$}+\varepsilon\right]\right\\}\geq
1-\varepsilon\,.$ (1.4)

Note that the statement in Theorem 3 does not depend on normalization, because
the angles are preserved regardless of any scaling.

For any two subsets
$\mathscr{M}^{\prime},\mathscr{M}^{\prime\prime}\subseteq\mathcal{W}$, let
$\operatorname{\sigma}(\mathscr{M}^{\prime},\mathscr{M}^{\prime\prime})$ be
the visual spectrum, which we define to be the set of sines of all angles
between distinct rays that start from the origin towards the points in
$\mathscr{M}^{\prime}$ and $\mathscr{M}^{\prime\prime}$, that is, denoting
identically a point $\mathfrak{m}$ and the ray from the origin towards
$\mathfrak{m}$,

$\operatorname{\sigma}(\mathscr{M}^{\prime},\mathscr{M}^{\prime\prime}):=\left\\{\sin(\mathfrak{m}^{\prime},\mathfrak{m}^{\prime\prime})\;:\;\mathfrak{m}^{\prime}\in\mathscr{M}^{\prime},\mathfrak{m}^{\prime\prime}\in\mathscr{M}^{\prime\prime},\;\mathfrak{m}^{\prime}\neq\mathfrak{m}^{\prime\prime}\right\\}.$
(1.5)

If $\mathscr{M}^{\prime}=\mathscr{M}^{\prime\prime}=\mathscr{M}$, we write
shortly $\operatorname{\sigma}(\mathscr{M})$ instead of
$\operatorname{\sigma}(\mathscr{M},\mathscr{M})$. The angles between rays from
the origin to points in $\mathcal{W}$ cover a larger and larger set of
possibilities as the dimension increases and in the limit, as $d\to\infty$,
there is a limit set of the spectrum $\operatorname{\sigma}(\mathscr{W})$,
which is the interval $[0,1]$. On top of that, choosing elements of
$\operatorname{\sigma}(\mathcal{W})$ is a random variable, which, by Theorem
3, has a limit probability density function $f(t)$ that is discrete and
concentrated in a single point, and
$f(t)=\delta\big{(}t-\frac{\sqrt{7}}{4}\big{)}$, for $0\leq t\leq 1$, where
$\delta$ is the Dirac distribution.

Since most points in $\mathcal{W}$ are visible from each other, the results in
Theorems 1, 3 and Corollary 1 may prove useful to check particularities
related to randomness of large set of data. A related result about points on
hyperspheres appearred in a theoretical context in the theory of neural
network (see Bubeck and Sellke [4]).

In different contexts in nature, it happens and it is not uncommon for a
property that is proved to be valid for almost overall objects in a certain
universe to be difficult or even impossible to build or to indicate just a
single instance that satisfy it. However, in the context of the hypercube
lattice $\mathcal{W}$, we can extract some distinguished polytopes that offer
a cross-section view of its inner structure.

Let
$\mathscr{C}=\\{\mathfrak{c}_{0},\mathfrak{c}_{1},\dots,\mathfrak{c}_{d}\\}$
to be the set of points whose coordinates are the rows of the circular
symmetric matrix

$M_{\mathscr{C}}=\begin{bmatrix}0&1&\cdots&d-1&d\\\ 1&2&\cdots&d&0\\\
2&3&\cdots&0&1\\\ \vdots&\vdots&\cdots&\vdots&\vdots\\\
d-1&d&\cdots&d-3&d-2\\\ d&0&\cdots&d-2&d-1\end{bmatrix}$ (1.6)

and let $\mathscr{G}:=\\{\mathfrak{g}_{0},\dots,\mathfrak{g}_{p-1}\\}$ be the
set of points whose components are the rows of the matrix

$M_{\mathscr{G}}=\begin{bmatrix}0&1^{-1}&\cdots&(p-2)^{-1}&(p-1)^{-1}\\\
1^{-1}&2^{-1}&\cdots&(p-1)^{-1}&0\\\ 2^{-1}&3^{-1}&\cdots&0&1^{-1}\\\
\vdots&\vdots&\cdots&\vdots&\vdots\\\
(p-2)^{-1}&(p-1)^{-1}&\cdots&(p-4)^{-1}&(p-3)^{-1}\\\
(p-1)^{-1}&0&\cdots&(p-3)^{-1}&(p-2)^{-1}\end{bmatrix}$ (1.7)

Here $p$ is prime, the classes of the representatives of the inverses in
$M_{\mathscr{G}}$ are taken from $\\{1,\dots,p-1\\}$ and for symmetry, by
convention, we may set $0$ to be ’the inverse’ of $0$.

######  Theorem 4.

Let $d\geq 2$ and $p$ be prime. Then we have:

1\. Any point in $\mathscr{C}\cup\mathscr{G}$ is visible from the origin. Any
two points in $\mathscr{G}$ are visible from each other. If $d=p-1$ and $p$ is
large enough any two points in $\mathscr{C}\cup\mathscr{G}$ are visible from
each other.

2\. The limit set of the normalized distances between points in $\mathscr{C}$
is the interval $[0,1/2]$, as $d$ tends to infinity.

3\. The limit set of the normalized distances between points in $\mathscr{G}$
consists of the single point $\\{1/\sqrt{6}\\}$, as $p$ tends to infinity.

4\. If $d=p-1$, the limit set of the normalized distances between points in
$\mathscr{C}$ and points in $\mathscr{G}$ is also $\\{1/\sqrt{6}\\}$, as $p$
tends to infinity.

5\. The limit of the spectrum $\operatorname{\sigma}(\mathscr{C})$ is the
interval $[0,\sqrt{39}/8]$, as $d$ tends to infinity.

6\. The limit of the spectrum $\operatorname{\sigma}(\mathscr{G})$ consists of
the single point $\\{\sqrt{7}/4\\}$, as $p$ tends to infinity.

7\. If $d=p-1$, the limit of the spectrum
$\operatorname{\sigma}({\mathscr{C},\mathscr{G}})$ consists of the single
point $\\{\sqrt{7}/4\\}$, also, as $p$ tends to infinity.

Note the decimal approximation of the size of the spectra in Theorem 4:

$\sqrt{7}/4\approx 0.661438$, $\arcsin(\sqrt{7}/4)\approx 0.72273$ radians or
$\approx 41.40962^{\circ}$; and

$\sqrt{39}/8\approx 0.78063$, $\arcsin(\sqrt{39}/8)\approx 0.89566$ radians or
$\approx 51.31781^{\circ}$.

As one can see from Theorem 4, about a quarter of all distances
$\operatorname{\mathfrak{d}}_{d}(\bm{v},\bm{w})$ with
$\bm{v},\bm{w}\in\mathscr{C}\cup\mathscr{G}$ are singular, being different
from the other three quarters which in the limit are all equal to
$1/\sqrt{6}$. However, in Subsection 2.4 we prove that if $d=p-1$ then
$A_{p}(\mathscr{C}\cup\mathscr{G})$, the average of all normalized distances
between points in $\mathscr{C}\cup\mathscr{G}$, is still the same
$1/\sqrt{6}$, in the limit as $p\to\infty$.

In Section 2.5 we complement the phenomena observed in Theorem 4 with yet
another polytope $\mathscr{B}$ whose vertices are visible from each other,
even though they lie all almost aligned on a straight line. This set wraps
around the diameter of $\mathcal{W}$ being composed by close neighbors of the
equally spaced points on the longest diagonal of the cube. The limit set of
the normalized distances between the points in this example equals the full
interval $[0,1]$, if their number tends to infinity. The same goes for the
limit of the spectrum $\operatorname{\sigma}(\mathscr{B})$, which is the
interval $[0,1]$, also. Taken together, merged into a geometric spindle shape,
the polytopes $\mathscr{C},\mathscr{G}$ and $\mathscr{B}$ combine their
arithmetic and probabilistic properties keeping in balance the spinning top
intrinsic qualities of the still lattice hypercube $\mathcal{W}$.

The paper is organized as follows. In Section 2 we present the special
polytopes $\mathscr{C},\mathscr{G}$ and $\mathscr{B}$, checking the visibility
and the mutual distances between their vertices, which proves Theorem 4. In
Section 3 we turn to the visibility in the whole lattice and calulate the size
of $\Omega$. In Section 4 we find the average of the distances between points
in $\mathcal{W}$ that are visible from each other and in Section 5 we estimate
the second moment about their mean. We use these results in Section 6 to
obtain effective results that in particular prove Theorems 1, 3 and Corollary
1. In Section 7 we discuss at large the problem of self-visible $K$-polytopes
and prove Theorem 2. We conclude in Section 8 with a possible good place to
start. It is a short heuristics that might be useful to adjust with the little
peculiarities that appear from higher dimensions. It is an intuitive touch on
the matter, although it is done in a continuous, where visibility has no
meaning, unlike the discrete universe which we explore beyond.

##  2\. Three distinguished polytopes. Their edges and diagonals.

Here we discuss three examples of polytopes with a number of vertices of order
almost equal in size with the dimension of the hypercube. The polytopes
$\mathscr{C}$ and $\mathscr{G}$ whose vertices are the rows of the matrices
$M_{\mathscr{C}}$ and $M_{\mathscr{G}}$ introduced by (1.6) and (1.7) are as
similar in construction as they are very different in shape. The first has the
distances between its vertices well spread over a long interval, while the
second has all the distances between the vertices approximately equal, being
as ‘equilateral’ as it could be, as $d\to\infty$.

###  2.1. Proof of Theorem 4 – visibility

Notice first that by the definition of $\mathscr{C}$ and $\mathscr{G}$ and
that of visibility (1.1), all points in $\mathscr{C}\cup\mathscr{G}$ are
visible from the origin.

####  2.1.1. Any two points belonging to either $\mathscr{C}$ or $\mathscr{G}$
are visible from each other

Let us suppose $d=p-1$ and let $\bm{v},\bm{w}\in\mathcal{W}$. Also, suppose
that the coordinates of $\bm{v}$ are a permutation of $\\{0,1,\dots,d\\}$ and
the coordinates of $\bm{w}$ are a circular rotation of the coordinates of
$\bm{v}$. Then, if $\bm{v}$ and $\bm{w}$ were not visible from each other,
then it would exist an integer $b\geq 2$ such that the following congruences
would hold:

$v_{0}-w_{0}\equiv 0\left(\mathrm{mod\;}b\right);\ v_{1}-w_{1}\equiv
0\left(\mathrm{mod\;}b\right);\,\dots;\ v_{d}-w_{d}\equiv
0\left(\mathrm{mod\;}b\right).$ (2.1)

But since $p$ is prime and $v_{0},\dots,v_{d}$ are all distinct, as
$w_{0},\dots,w_{d}$ also are, and since they belong to the same set of
numbers, $\\{0,1,\dots,d\\}$, which appear each in exactly two of the
congruences in (2.1), we find that

$v_{0}\equiv v_{1}\equiv\cdots\equiv v_{d}\equiv
r\left(\mathrm{mod\;}b\right),$

for some $r\in\\{0,1,\dots,b-1\\}$. But this is impossible, unless $b=1$.
Therefore, two points that belong to one and the same set, be it either
$\mathscr{C}$ or $\mathscr{G}$ are visible from each other.

####  2.1.2. Any two points $\mathfrak{c}\in\mathscr{C}$ and
$\mathfrak{g}\in\mathscr{G}$ are visible from each other

Suppose $d=p-1$ and let $\mathfrak{c}\in\mathscr{C}$ and
$\mathfrak{g}\in\mathscr{G}$. Denote by
$g=\gcd(v_{1}-w_{1},\dots,v_{d}-w_{d})$ the expression that needs to be
checked in the condition (1.1). Since $g$ is invariant under the same circular
rotation applied to both $\mathfrak{c}\in\mathscr{C}$ and
$\mathfrak{g}\in\mathscr{G}$, we may assume that

$\begin{array}[]{ccccccccl}\mathfrak{g}=(0,&1^{-1},&\dots,&(p-1-h)^{-1},&(p-h)^{-1},&(p+1-h)^{-1},&\dots,&(p-1)^{-1}&);\\\
\mathfrak{c}=(h,&h+1,&\dots,&p-1,&0,&1,&\dots,&h-1)\,,&\end{array}$ (2.2)

for some $h\in\\{0,1,\dots,p-1\\}$. As usual, the coordinates are taken as
their representatives modulo $p$ in the interval $[0,p-1]$. Since
$1^{-1}\equiv 1\left(\mathrm{mod\;}p\right)$ and $(p-1)^{-1}\equiv
p-1\left(\mathrm{mod\;}p\right)$, the difference between the second components
of $\mathfrak{c}$ and $\mathfrak{g}$ is $(h+1)-1^{-1}=h$ and the difference
between the last components is $(h-1)-(p-1)^{-1}=h-p$. Because $p$ is prime,
these differences are relatively prime, so that $\mathfrak{c}$ and
$\mathfrak{g}$ are visible from each other unless $h=0$.

Suppose now that $h=0$ in (2.2). Then, if $\mathfrak{c}$ is not visible from
$\mathfrak{g}$, there exists a prime number $2\leq q\leq p$ such that
$q\mid(n-n^{-1})$ for $1\leq n\leq p-1$. Let us notice that for any $0\leq
r\leq p-1$

$\\#\left\\{1\leq n\leq p-1\;:\;\left|n-n^{-1}\right|=r\right\\}\leq 4.$

This is because $n-n^{-1}\equiv\pm r\left(\mathrm{mod\;}p\right)$ is
equivalent to $n^{2}\mp rn-1\equiv 0\left(\mathrm{mod\;}p\right)$, congruence
that has at most two solutions for each sign. Even more precise, if $r\neq 0$,
if the congruence $n-n^{-1}\equiv r\left(\mathrm{mod\;}p\right)$ has solution
$a$ then it has solution $-a^{-1}$, also. These solutions are always distinct
unless $a\equiv-a^{-1}\left(\mathrm{mod\;}p\right)$, which happens only if
$p\equiv 1\left(\mathrm{mod\;}4\right)$, in which case
$a=\big{(}\frac{p-1}{2}\big{)}!$. If $r=0$, there are exactly three values of
$n\in\\{0,1,\dots,p-1\\}$ for which $n-n^{-1}\equiv
r\left(\mathrm{mod\;}p\right)$, namely $0,1,p-1$. In conclusion, putting
together these observations, while counting separately in the cases $p=2$,
$p\equiv 1\left(\mathrm{mod\;}4\right)$ and $p\equiv
3\left(\mathrm{mod\;}4\right)$, we obtain in all cases the same number of
distinct absolute values of differences

$\\#\left\\{\left|n-n^{-1}\right|\;:\;1\leq n\leq
p-1\right\\}=\left\lfloor\frac{p}{4}\right\rfloor+1.$ (2.3)

Then, since

$\left\\{\left|n-n^{-1}\right|\;:\;1\leq n\leq
p-1\right\\}\subset\\{0,1,\dots,p-1\\}$

and by our assumption a prime $q$ divides all differences $n-n^{-1}$, it
follows that $q$ has to be either $2$ or $3$.

If $q=2$, the equality (2.3) says that the number of pairs $(n,n^{-1})$,
$1\leq n\leq p-1$ of the same parity is $\lfloor p/4\rfloor+1$. But this is
not in agreement with Lehmer’s conjecture [12, Problem F12], which is proved
also for shorter general arithmetic progressions[8, Theorem 1]). A particular
case of that result shows that if $I,J\subset\\{1,\dots,p-1\\}$ are arithmetic
progressions of ratios $d_{1},d_{2}\geq 1$, then

$\\#\left\\{(a,b)\in I\times J\;:\;ab\equiv
1\left(\mathrm{mod\;}p\right)\right\\}=\frac{\\#I\cdot\\#J}{p}+O\left(p^{1/2}\log^{2}p\right).$
(2.4)

Then, if $d_{1}=d_{2}=2$, counting the pairs $(n,n^{-1})$ with either both
even or both odd components, we see that their total number is
$p/2+O\left(p^{1/2}\log^{2}p\right)$, which contradicts (2.3). Likewise, in
the remaining case $q=3$, with $d_{1}=d_{2}=3$, counting the pairs
$(n,n^{-1})$ whose components both give the same remainder $0$, $1$ or $2$
when dividing by $3$, we find that their total number is
$p/3+O\left(p^{1/2}\log^{2}p\right)$, which is also different from (2.3). In
conclusion, $\mathfrak{c}$ and $\mathfrak{g}$ are visible from each other,
which concludes the proof of the first part of Theorem 4.

###  2.2. Proof of Theorem 4 – the distances

####  2.2.1. Distances between points of $\mathscr{C}$

Remark that the same rotation applied to the coordinates of two points, does
not change the distance between them, which, in particular, shows that we have

$\operatorname{\mathfrak{d}}(\mathfrak{c}_{k},\mathfrak{c}_{l})=\operatorname{\mathfrak{d}}(\mathfrak{c}_{0},\mathfrak{c}_{l-k})\,,\text{
for any $0\leq k\leq l\leq d$.}$ (2.5)

This means that the range of values of all distances between any two points in
$\mathscr{C}$ is covered by the distances between $\mathfrak{c}_{0}$ and each
of $\mathfrak{c}_{1},\dots,\mathfrak{c}_{d}$. A straightforward calculation
shows that in closed form these are:

$\begin{array}[]{rl}\operatorname{\mathfrak{d}}(\mathfrak{c}_{0},\mathfrak{c}_{1})&=\left((d-0)\cdot
1^{2}+1\cdot(d-0)^{2}\right)^{1/2}\\\
\operatorname{\mathfrak{d}}(\mathfrak{c}_{0},\mathfrak{c}_{2})&=\left((d-1)\cdot
2^{2}+2\cdot(d-1)^{2}\right)^{1/2}\\\
\operatorname{\mathfrak{d}}(\mathfrak{c}_{0},\mathfrak{c}_{3})&=\left((d-2)\cdot
3^{2}+3\cdot(d-2)^{2}\right)^{1/2}\\\ {2}\\\
\operatorname{\mathfrak{d}}(\mathfrak{c}_{0},\mathfrak{c}_{d})&=\left((d-(d-1))\cdot
d^{2}+d\cdot(d-(d-1))^{2}\right)^{1/2}.\end{array}$ (2.6)

Not all of these numbers are distinct, because of the symmetry of the
parabola: $x\mapsto f(x)$, where $f(x)=(d-(x-1))\cdot
x^{2}+x\cdot(d-(x-1))^{2}=(d+1)x(d+1-x)$, for $x\in[0,d+1]$. The maximum of
$f(x)$ is attained for $x=(d+1)/2$ and it is equal to $(d+1)^{3}/4$. Also,
$f(x)=f(d+1-x)$ and the values of $f(x)$ on the integers between $0$ and $d+1$
cover quite uniformly the interval $[0,(d+1)^{3}/4]$ as $d$ becomes
sufficiently large. Precisely, for any $y\in[0,1/2]$ and any $\varepsilon>0$,
there are $\mathfrak{c}^{\prime},\mathfrak{c}^{\prime\prime}\in\mathscr{C}$
such that
$y-\varepsilon<\operatorname{\mathfrak{d}}_{d}(\mathfrak{c}^{\prime},\mathfrak{c}^{\prime\prime})<y+\varepsilon$.
We summarize in the following proposition these remarks on the polytope
$\mathscr{C}$.

######  Proposition 2.2.1.

Let
$\mathscr{C}=\\{\mathfrak{c}_{0},\mathfrak{c}_{1},\dots,\mathfrak{c}_{d}\\}$
be the set of points whose coordinates are the rows of matrix (1.6). Then, the
set of normalized distances between any two points in $\mathscr{C}$ is equal
to

$\mathcal{D}(\mathscr{C}):=\left\\{\frac{\sqrt{(d+1)x(d+1-x)}}{d^{3/2}}\;:\;0\leq
x\leq\left\lfloor\mbox{\small$\displaystyle\frac{d+1}{2}$}\right\rfloor\right\\}$
(2.7)

and the set $\mathcal{D}(\mathscr{C})$ is dense in the interval $[0,1/2]$ as
$d$ tends to infinity.

####  2.2.2. Distances between points of $\mathscr{G}$

Let $p$ be a prime number and $N=d=p-1$. The polytope
$\mathscr{G}=\\{\mathfrak{g}_{0},\dots,\mathfrak{g}_{p-1}\\}$ is formally
close to $\mathscr{C}$. The components of the points are the same, except that
the numbers are inverted modulo $p$. The classes of the representatives of the
inverses are taken from $\\{1,\dots,p-1\\}$ and by convention the inverse of
an integer divisible by $p$, which does not exist, is always replaced by $0$.
Let us remark that the influence of just a single component in the first
point, while the others are obtained by circular rotations as in
$\mathscr{G}$, has small and even negligible influence as $p\to\infty$, on the
mutual distances between the points in $\mathscr{G}$. This is why we could
keep, for balance, in $\mathscr{G}$ the components zero, even if zero has no
inverse modulo $p$.

The main motivation for choosing $\mathscr{G}$ is the random spread of the
inverses. Various ways to measure the randomness of inverses, triggered by
[12, Problem F12], have been studied in [6, 8, 7]. In [23] the focus is on the
values of polynomials and rational functions mod $p$ and the results there
might be also used to build other polytopes with similar characteristics.

######  Lemma 2.1.

If $p$ is prime and $1\leq h\leq p-1$, we have

$\sum_{x\in\mathbb{F}_{p}\setminus\\{0,p-h\\}}\left|(x+h)^{-1}-x^{-1}\right|^{2}=\frac{p^{3}}{6}+O\left(p^{5/2}\log^{2}p\right).$
(2.8)

Here the inverses are calculated in $\mathbb{F}_{p}$ and the absolute value
calculates the distance between two natural numbers in $\\{0,1,\dots,p-1\\}$,
the corresponding representatives of the residue classes mod $p$ of the
inverses.

For $h=1$, the estimate (2.8) is a particular case of [23, Corollary 1.3],
which is proved using Weil’s bounds [22] for exponential sums with rational
functions. For $h\geq 2$ the estimate (2.8) can be proved in a similar manner.

Taking the square root and dividing by $p^{3/2}$, we find by Lemma 2.1, that
the normalized distance between any two points
$\mathfrak{g}^{\prime},\mathfrak{g}^{\prime\prime}\in\mathscr{G}$ is

$\operatorname{\mathfrak{d}}_{d}(\mathfrak{g}^{\prime},\mathfrak{g}^{\prime\prime})=\mbox{\small$\displaystyle\frac{1}{\sqrt{6}}$}\left(1+O\left(\mbox{\small$\displaystyle\frac{\log^{2}p}{\sqrt{p}}$}\right)\right),$
(2.9)

which proves part 3 of Theorem 4.

####  2.2.3. Distances between $\mathfrak{c}\in\mathscr{C}$ and
$\mathfrak{g}\in\mathscr{G}$

It suffices to find the distance between $\mathfrak{c}$ and $\mathfrak{g}$ in
(2.2). For this we have to estimate the sums

$\operatorname{\mathfrak{d}}^{2}(\mathfrak{g},\mathfrak{c})=\sum_{n=0}^{p-h-1}\left|(n+h)-n^{-1}\right|^{2}+\sum_{n=p-h}^{p-1}\left|(n+h-p)-n^{-1}\right|^{2}=\Sigma_{h}^{\prime}+\Sigma_{h}^{\prime\prime},$
(2.10)

where $\Sigma_{h}^{\prime}$ and $\Sigma_{h}^{\prime\prime}$ are the first and
the second sum in (2.10), respectively. To calculate $\Sigma_{h}^{\prime}$,
let $L>1$ be fixed, denote $u=(p-h)/L$, $v=p/L$ and split the rectangle
$[0,p-h]\times[0,p]$ into $L^{2}$ rectangles
$T_{j,k}:=\big{[}ju,(j+1)u\big{)}\times\big{[}kv,(k+1v)\big{)}$. Then

$\begin{split}\Sigma_{h}^{\prime}&=\sum_{j=0}^{L-1}\sum_{k=0}^{L-1}\\!\\!\\!\sum_{\
\ (n,n^{-1})\in T_{j,k}}\left(n+h-n^{-1}\right)^{2}.\end{split}$

Here the size of the summand can be kept under control, so that we can replace
it by its value on the lower left corner of $T_{j,k}$. Thus, on using (2.4)
with $I\times J=T_{j,k}$, we have

$\begin{split}\Sigma_{h}^{\prime}&=\sum_{j=0}^{L-1}\sum_{k=0}^{L-1}\left(ju+h-kv+O(p/L)\right)^{2}\left(\frac{uv}{p}+O\left(p^{1/2}\log^{2}p\right)\right).\end{split}$

Now we factor the terms that do not depend on $j,k$ and expand the square

$\begin{split}\Sigma_{h}^{\prime}&=\left(\frac{uv}{p}+O\left(p^{1/2}\log^{2}p\right)\right)\sum_{j=0}^{L-1}\sum_{k=0}^{L-1}g(j,k,u,v,p,L)\end{split}$
(2.11)

where

$\begin{split}g(j,k,u,v,p,L)=&j^{2}u^{2}+h^{2}+k^{2}v^{2}+2juh-2jkuv-2hkv\\\
&+O(p^{2}/L^{2})+O\Big{(}p(ju+h+kv)/L\Big{)}.\end{split}$

Adding together the terms separately over $k$ and $j$, the sum of powers being
denoted by $S_{r}(M)=1^{r}+\cdots+M^{r}$, and then collecting together the
error terms, the double sum from (2.11) becomes

$\begin{split}\sum_{j=0}^{L-1}\sum_{k=0}^{L-1}g(j,k,u,v,p,L)=&Lu^{2}S_{2}(L-1)+L^{2}h^{2}+Lv^{2}S_{2}(L-1)\\\
&+2LuhS_{1}(L-1)-2uvS_{1}^{2}(L-1)-2LhvS_{1}(L-1)\\\
&+O(p^{2})+O\Big{(}p\big{(}LuS_{1}(L)+hL^{2}+LvS_{1}(L)\big{)}/L\Big{)}\\\
=&\frac{L^{4}u^{2}}{3}+L^{2}h^{2}+\frac{L^{4}v^{2}}{3}+L^{3}uh-\frac{L^{4}uv}{2}-L^{3}vh+O\left(p^{2}L\right).\end{split}$

Next we insert this into (2.11), replace $u,v$ by their definition and reduce
the terms:

$\begin{split}\Sigma_{h}^{\prime}&=\Big{(}\mbox{\small$\displaystyle\frac{uv}{p}$}+O\big{(}\sqrt{p}\log^{2}p\big{)}\Big{)}\left(\mbox{\small$\displaystyle\frac{L^{4}(u^{2}+v^{2})}{3}$}+L^{2}h^{2}-\mbox{\small$\displaystyle\frac{L^{4}uv}{2}$}-L^{3}h(v-u)+O\left(p^{2}L\right)\right)\\\
&=\Big{(}p-h+O\big{(}L^{2}\sqrt{p}\log^{2}p\big{)}\Big{)}\left(\mbox{\small$\displaystyle\frac{p^{2}+(p-h)^{2}}{3}$}-\mbox{\small$\displaystyle\frac{p(p-h)}{2}$}+O\left(p^{2}/L\right)\right)\\\
&=\frac{(p-h)(p^{2}+2h^{2}-hp)}{6}+O(p^{3}/L)+O\left(L^{2}p^{5/2}\log^{2}p\right).\end{split}$
(2.12)

To estimate $\Sigma^{\prime\prime}_{h}$, we make the change of variables
$m=p-n$. Note that the representative in the interval $[0,p-1]$ of the inverse
of $m$ is $m^{-1}=p-n^{-1}$. Then

$\begin{split}\Sigma_{h}^{\prime\prime}&=\sum_{n=p-h}^{p-1}\left|(n+h-p)-n^{-1}\right)|^{2}=\sum_{m=1}^{h}\left|(m+p-h)-m^{-1}\right|^{2}.\end{split}$

Apart from the end limits of summation, this is exactly
$\Sigma^{\prime}_{p-h}$. Therefore we have

$\Sigma_{h}^{\prime\prime}=\Sigma_{p-h}^{\prime}+O(p^{2}).$ (2.13)

On combining the estimate (2.12) with (2.13) and inserting the results into
(2.10), we obtain

$\begin{split}\operatorname{\mathfrak{d}}^{2}(\mathfrak{g},\mathfrak{c})&=\frac{(p-h)(p^{2}+2h^{2}-hp)+h(2p^{2}+2h^{2}-3hp)}{6}+O\left(p^{3}/L+L^{2}p^{5/2}\log^{2}p\right)\\\
&=\frac{p^{3}}{6}+O\left(p^{3}/L+L^{2}p^{5/2}\log^{2}p\right).\end{split}$
(2.14)

Balancing the error terms, we find the optimal $L$ that we have fixed at the
beginning, namely $L=\left\lfloor p^{1/6}\log^{-2/3}p\right\rfloor$. Thus we
have proved the following result.

######  Proposition 2.2.2.

Let $d\geq 2$ and let $p$ be prime such that $d=p-1$. Let
$\mathscr{C}=\\{\mathfrak{c}_{0},\mathfrak{c}_{1},\dots,\mathfrak{c}_{d}\\}$
be the set of points whose coordinates are the rows of matrix
$M_{\mathscr{C}}$ from (1.6) and let
$\mathscr{G}=\\{\mathfrak{g}_{0},\mathfrak{g}_{1},\dots,\mathfrak{g}_{d}\\}$
be the set of points whose coordinates are the rows of matrix
$M_{\mathscr{G}}$ from (1.7). Then, as $p$ tends to infinity, the limit set of
the normalized distances between any two points $\mathfrak{c}\in\mathscr{C}$
and $\mathfrak{g}\in\mathscr{G}$ is the single point $\\{1/\sqrt{6}\\}$ and

$\operatorname{\mathfrak{d}}_{d}(\mathfrak{g},\mathfrak{c})=\frac{1}{\sqrt{6}}+O\left(p^{-1/6}\log^{2/3}p\right).$
(2.15)

Proposition 2.2.2 proves part 4 of Theorem 4.

###  2.3. Proof of Theorem 4 – the spectra

From the origin, which we denote by $\bm{0}$, the normalized distances toward
points in $\mathscr{C}$ or $\mathscr{G}$ are equal

$\operatorname{\mathfrak{d}}_{d}(\bm{0},\mathfrak{d}_{h})=\operatorname{\mathfrak{d}}_{d}(\bm{0},\mathfrak{c}_{h})=\left(\frac{d(d+1)(2d+1)}{6}\right)^{1/2}d^{-3/2}=\frac{1}{\sqrt{3}}+O(1/d),$
(2.16)

for $0\leq h\leq d$, if $p=d+1$. The distances between points in $\mathscr{C}$
are given by Proposition 2.2.1. Since the set of distances between points in
$\mathscr{C}$ are in the limit, as $d\to\infty$, dense in the interval
$[0,1/2]$, the limit of the spectrum $\operatorname{\sigma}(\mathscr{C})$ is
also a continuous interval. The end points of the limit
$\operatorname{\sigma}(\mathscr{C})$ come from the limit angles of the
isosceles triangles with vertices in $\bm{0}$ having two edges equal to
$1/\sqrt{3}+O(1/d)$, according to (2.16), while the third edge is the shortest
and the longest distance between points in
$\operatorname{\sigma}(\mathscr{C})$, respectively. By (2.7), the acutest
triangle has its third edge equal to $O(1/d)$, while the triangle with the
largest angle at $\bm{0}$ has its third edge equal to $1/2+O(1/d)$. Then a
straightforward calculation gives the end points of the limit spectrum $0$ and
$\sqrt{39}/8$.

If $d=p-1$, the mutual distances between points either from $\mathscr{G}$ or
from $\mathscr{C}\cup\mathscr{G}$ are all equal to
$1/\sqrt{6}+O\left(p^{-1/6}\log^{2/3}p\right)$, by relation (2.9) and
Proposition 2.2.2, respectively. Then, the limit spectra
$\operatorname{\sigma}(\mathscr{G})$ and
$\operatorname{\sigma}(\mathscr{C}\cup\mathscr{G}))$ are equal and discrete,
containing exactly one point. According to (2.16), the limit point is the sine
of the acutest angle of the isosceles triangle with two edges equal to
$1/\sqrt{3}$ and the third equal to $1/\sqrt{6}$. Since this is equal to
$\sqrt{7}/4$, these concludes the proof of the remaining parts of Theorem 4.

###  2.4. The average distance between points in $\mathscr{C}\cup\mathscr{G}$

Suppose $d=p-1$. The cardinality of $\mathscr{C}\cup\mathscr{G}$ is $4p^{2}$
and the average of the squares of distances between its points is
$A(\mathscr{C}\cup\mathscr{G})=T/(4p^{2})$, where $T$ is the following sum

$\begin{split}T=\sum_{(\mathfrak{c}^{\prime},\mathfrak{c}^{\prime\prime})\in\mathscr{C}\times\mathscr{C}}\operatorname{\mathfrak{d}}^{2}(\mathfrak{c}^{\prime},\mathfrak{c}^{\prime\prime})+\sum_{(\mathfrak{g}^{\prime},\mathfrak{g}^{\prime\prime})\in\mathscr{G}\times\mathscr{G}}\operatorname{\mathfrak{d}}^{2}(\mathfrak{g}^{\prime},\mathfrak{g}^{\prime\prime})+2\sum_{(\mathfrak{c},\mathfrak{g})\in\mathscr{C}\times\mathscr{G}}\operatorname{\mathfrak{d}}^{2}(\mathfrak{c},\mathfrak{g}).\end{split}$
(2.17)

We denote by $T_{1},T_{2},T_{3}$ the sums on the right side of (2.17). By
(2.6), the first sum is

$\begin{split}T_{1}=2\sum_{h=1}^{p-1}(p-h)\cdot\big{(}ph(p-h)\big{)}=2p\big{(}pS_{2}(p-1)+S_{3}(p-1)\big{)}=\frac{p^{5}}{6}+O\left(p^{4}\right).\end{split}$
(2.18)

By (2.9) and (2.15) the last two sums in (2.17) together are

$\begin{split}T_{2}+T_{3}=6\sum_{h=1}^{p-1}h\left(\frac{p^{3}}{6}+O\left(p^{17/6}\log^{2/3}p\right)\right)=\frac{p^{5}}{2}+O\left(p^{29/6}\log^{2/3}p\right).\end{split}$
(2.19)

Now we can find the normalized distances between points in
$\mathscr{C}\cup\mathscr{G}$ which is defined by

$\begin{split}A_{p}(\mathscr{C}\cup\mathscr{G}):=\sqrt{A(\mathscr{C}\cup\mathscr{G})}/p^{3/2}.\end{split}$
(2.20)

Thus, on inserting (2.19) and (2.18) into (2.17), we find that (2.20) becomes

$\begin{split}A_{p}(\mathscr{C}\cup\mathscr{G})&=\left(\frac{1}{4p^{2}}\bigg{(}\frac{p^{5}}{6}+\frac{p^{5}}{2}+O\left(p^{29/6}\log^{2/3}p\right)\bigg{)}\right)^{1/2}p^{-3/2}\\\
&=\frac{1}{\sqrt{6}}+O\left(p^{-1/6}\log^{2/3}p\right).\end{split}$ (2.21)

###  2.5. A polytope stretched out along the longest diagonal of $\mathcal{W}$

On the same theme, we construct a polytope
$\mathscr{B}=\\{\mathfrak{b}_{0},\dots,\mathfrak{b}_{d}\\}$ that is a cousin
of $\mathscr{C}$ and $\mathscr{G}$. The polytope $\mathscr{B}$ streches along
the diagonal $\big{[}(0,\dots,0);\;(d,\dots,d)\big{]}$, it has all vertices
visible from each other and the normalized distances between them are dense in
$[0,1]$, as the dimension $d$ tends to infinity. All components of
$\mathfrak{b}_{h}$ are set to be equal to $h$, except the $(h-1)$-th and
$(h+1)$-th, which are equal to $h-1$ and $h+1$, respectively. Thus

$\begin{array}[]{rlccccccccc}&\
\text{\scriptsize$0$-th}&&&&&\text{\scriptsize$h$-th}&&&&\text{\scriptsize$d$-th}\\\
\mathfrak{b}_{h}=&(\ h,&h,&\dots,&h,&h-1,&h,&h+1,&h,&\dots,&h\ ),\end{array}$
(2.22)

for $h=0,1,\dots,d$, with the convention that $-1=d$ and $d+1=0$.

If $d=3$ or $d\geq 5$ the points of $\mathscr{B}$ are visible from one
another. For points that are not too close this follows because most
components of any point are equal, while the neighbors of just one component
are the neighbor integers of the rank of the point. For points that are near
each other it can also be checked one by one that they are visible from each
other.

The distances between the points of $\mathscr{B}$ are:

$\operatorname{\mathfrak{d}}_{d}(\mathfrak{b}_{j},\mathfrak{b}_{k})=d^{-3/2}\sqrt{d|k-j|^{2}+O(1)}=\frac{|k-j|}{d}+O(1/d),$
(2.23)

for $1\leq j,k,\leq d$. As a consequence, (2.23) implies that the closure of
the set of distances between points in $\mathscr{B}$ equals the full interval
$[0,1]$, as $d$ tends to infinity.

Notice that all points in $\mathscr{B}$ are visible from the origin, because
(2.22) assures that condition (1.1) is verified.

The distances from the origin to points in $\mathscr{B}$ are

$\operatorname{\mathfrak{d}}_{d}(\bm{0},\mathfrak{b}_{h})=\frac{h}{d}+O(1/d),\text{
for $1\leq h\leq d$.}$ (2.24)

Since the limit set of the mutual distances between points in $\mathscr{B}$ is
the full interval $[0,1]$, on combining (2.23) and (2.24), we see that there
is a limit of the spectrum $\operatorname{\sigma}(\mathscr{B})$, which is also
a closed interval. Its smallest end point comes from the triangle with
vertices $\bm{0}$, $\mathfrak{b}_{d-2}$ and $\mathfrak{b}_{d-1}$, and its
largest from the triangle with vertices $\bm{0}$, $\mathfrak{b}_{1}$ and
$\mathfrak{b}_{d-1}$. Then the angle at $\bm{0}$ of the first triangle tends
to zero, and that of the second triangle tends to $\pi/2$, as $d\to\infty$. As
a consequence, the limit of the spectrum $\operatorname{\sigma}(\mathscr{B})$
is the interval $[0,1]$, as $d$ tends to infinity.

##  3\. The number of pairs in $\Omega$

Let $(\bm{v},\bm{w})\in\Omega$ and suppose $\bm{v}=(v_{1},\dots,v_{d})$ and
$\bm{w}=(w_{1},\dots,w_{d})$. Then $\bm{v}$ and $\bm{w}$ are visible from each
other. This means that $\gcd(v_{1}-w_{1},\dots,v_{d}-w_{d})=1$. We can rewrite
this condition by bringing Möbius summation into play. Thus, we have

$\sum_{\begin{subarray}{c}1\leq b\leq N\\\ b|v_{1}-w_{1}\\\ \cdots\\\
b|v_{d}-w_{d}\end{subarray}}\mu(b)=\begin{cases}1&\text{if
$(\bm{v},\bm{w})\in\Omega$},\\\\[8.0pt] 0&\text{if
$(\bm{v},\bm{w})\not\in\Omega$}.\end{cases}$ (3.1)

We start by finding an estimate for the cardinality of $\Omega$, which is the
object of the following lemma.

######  Lemma 3.1.

There exists an absolute constant $C_{0}>0$, such that for all $d\geq 2$ and
all $N\geq 3d$, we have

$\left|\\#\Omega-\frac{N^{2d}}{\zeta(d)}\right|\leq\begin{cases}C_{0}N^{3}\log
N&\text{ if $d=2$},\\\\[8.0pt] C_{0}dN^{2d-1}&\text{ if $d\geq
3$}.\end{cases}$ (3.2)

###### Proof.

By the definition and the counting formula (3.1), by changing the order of
summation, we have

$\begin{split}\\#\Omega&=\sum_{\bm{v}\in\mathcal{W}}\sum_{\begin{subarray}{c}\bm{w}\in\mathcal{W}\\\
(\bm{v},\bm{w})\in\Omega\end{subarray}}1=\sum_{\bm{v}\in\mathcal{W}}\sum_{\bm{w}\in\mathcal{W}}\sum_{\begin{subarray}{c}b|(v_{1}-w_{1})\\\
\cdots\\\
b|(v_{d}-w_{d})\end{subarray}}\mu(d)=\sum_{b=1}^{N}\mu(b)\sum_{\begin{subarray}{c}0\leq
v_{1},w_{1}\leq N\\\
b|v_{1}-w_{1}\end{subarray}}\cdots\sum_{\begin{subarray}{c}0\leq
v_{d},w_{d}\leq N\\\ b|v_{d}-w_{d}\end{subarray}}1.\end{split}$

Since the variables run independently, the summation over $\bm{v}$ and
$\bm{w}$ can be grouped as a product as follows

$\begin{split}\\#\Omega&=\sum_{b=1}^{N}\mu(b)\bigg{(}\sum_{\begin{subarray}{c}0\leq
v_{1},w_{1}\leq N\\\
b|v_{1}-w_{1}\end{subarray}}1\bigg{)}\cdots\bigg{(}\sum_{\begin{subarray}{c}0\leq
v_{d},w_{d}\leq N\\\ b|v_{d}-w_{d}\end{subarray}}1\bigg{)}\,.\end{split}$
(3.3)

Next, we estimate the inner sums that are equal to each other for all
$j\in\\{1,\dots,d\\}$. Dropping the subscripts, we see that each of them is
equal to

$\begin{split}H:=\sum_{\begin{subarray}{c}0\leq v,w\leq N\\\
b|v-w\end{subarray}}1&=\sum_{0\leq r\leq b-1}\\#\\{(v,w):0\leq v,w\leq
N,v\equiv r\left(\mathrm{mod\;}b\right),w\equiv
r\left(\mathrm{mod\;}b\right)\\}\\\ &=\sum_{0\leq r\leq b-1}\big{(}\\#\\{0\leq
a\leq N\;:\;a\equiv r\left(\mathrm{mod\;}b\right)\\}\big{)}^{2}.\end{split}$

The cardinality of the inner set is equal to
$\left\lfloor\frac{N-r}{b}\right\rfloor+1=\frac{N}{b}+\theta_{1}(b,r,N)$, with
$|\theta(b,r,N)|\leq 1$. Then

$H=\sum_{0\leq r\leq
b-1}\left(\left\lfloor\frac{N-r}{b}\right\rfloor+1\right)^{2}=\sum_{0\leq
r\leq
b-1}\left(\frac{N^{2}}{b^{2}}+\theta_{2}(b,r,N)\cdot\frac{N}{b}\right)=\frac{N^{2}}{b}+\theta(b,N)N,$

for some real numbers for which $|\theta_{2}(b,r,N)|\leq 3$ and
$|\theta(b,N)|\leq 3.$ On inserting this estimate in (3.3), it yields

$\begin{split}\\#\Omega&=\sum_{b=1}^{N}\mu(b)H^{d}=\sum_{b=1}^{N}\mu(b)\left(\frac{N^{2d}}{b^{d}}+O\left(\sum_{k=1}^{d}\binom{d}{k}\bigg{(}\frac{N^{2}}{b}\bigg{)}^{d-k}(3N)^{k}\right)\right).\end{split}$
(3.4)

Here, the main term is

$\begin{split}\sum_{b=1}^{N}\mu(b)\frac{N^{2d}}{b^{d}}&=N^{2d}\sum_{b=1}^{\infty}\mu(b)b^{-d}+O\left(N^{2d}\int_{N}^{\infty}x^{-d}\operatorname{d}x\right)=\frac{N^{2d}}{\zeta(d)}+O\left(\frac{N^{d+1}}{d}\right).\end{split}$
(3.5)

Denoting the error term in (3.4) by $E_{1}$ and changing the order of
summation we find that

$\begin{split}|E_{1}|&=O\left(\sum_{b=1}^{N}\sum_{k=1}^{d}\binom{d}{k}\frac{N^{2d-2k}}{b^{d-k}}3^{k}N^{k}\right)=O\left(\sum_{k=1}^{d}3^{k}N^{2d-k}\binom{d}{k}T_{d-k}(N)\right),\end{split}$
(3.6)

where $T_{r}(N):=1^{-r}+\cdots+N^{-r}$. Then $T_{d-k}(N)=N$, if $k=d$,
$T_{d-k}(N)=\log N$, if $k=d-1$ and $T_{d-k}(N)=O(1)$ if $1\leq k\leq d-2$.
Then

$\begin{split}|E_{1}|&=O\left(3^{d}N^{d+1}\right)+O\left(3^{d}N^{d+1}d\log
N\right)+O\left(N^{2d}\sum_{k=1}^{d-2}3^{k}N^{-k}\binom{d}{k}\right),\end{split}$
(3.7)

The lemma follows by inserting the estimates (3.5) and (3.7) into (3.4).

∎

##  4\. The average distance between points visible from each other

The average of the square of distances between points visible from each other
is

$\begin{split}A_{vis}(d,N)&:=\frac{1}{\\#\Omega}\sum_{(\bm{v},\bm{w})\in\Omega}\operatorname{\mathfrak{d}}^{2}(\bm{v},\bm{w}).\end{split}$
(4.1)

By (3.1), changing the order summation this is

$\begin{split}A_{vis}(d,N)&=\frac{1}{\\#\Omega}\sum_{b=1}^{N}\mu(b)\sum_{\bm{v}\in\mathcal{W}}\sum_{\begin{subarray}{c}\bm{w}\in\mathcal{W}\\\
b|(v_{1}-w_{1})\\\ \cdots\\\
b|(v_{d}-w_{d})\end{subarray}}\operatorname{\mathfrak{d}}^{2}(\bm{v},\bm{w}).\end{split}$
(4.2)

We rewrite (4.2) as

$\begin{split}A_{vis}(d,N)&=\frac{1}{\\#\Omega}\sum_{b=1}^{N}\mu(b)\sum_{\bm{v}\in\mathcal{W}}\sum_{\begin{subarray}{c}\bm{w}\in\mathcal{W}\\\
b|(v_{1}-w_{1})\\\ \cdots\\\
b|(v_{d}-w_{d})\end{subarray}}\left((w_{1}-v_{1})^{2}+\cdots+(w_{d}-v_{d})^{2}\right)=\sum_{j=1}^{d}H_{j},\end{split}$
(4.3)

where

$\begin{split}H_{j}&:=\frac{1}{\\#\Omega}\sum_{b=1}^{N}\mu(b)\sum_{\bm{v}\in\mathcal{W}}\sum_{\begin{subarray}{c}\bm{w}\in\mathcal{W}\\\
b|(v_{1}-w_{1})\\\ \cdots\\\
b|(v_{d}-w_{d})\end{subarray}}(w_{j}-v_{j})^{2}.\end{split}$ (4.4)

By changing the order of summation to isolate the part that does not depend on
the $j$ variables, $H_{j}$ can be rewritten as

$\begin{split}H_{j}&=\frac{1}{\\#\Omega}\sum_{b=1}^{N}\mu(b)\bigg{(}\sum_{\begin{subarray}{c}0\leq
v_{j},w_{j}\leq N\\\
b|(v_{j}-w_{j})\end{subarray}}(w_{j}-v_{j})^{2}\bigg{)}\prod_{\begin{subarray}{c}k=1\\\
k\not=j\end{subarray}}^{d}\bigg{(}\sum_{\begin{subarray}{c}0\leq
v_{k},w_{k}\leq N\\\ b|(v_{k}-w_{k})\end{subarray}}1\bigg{)}\\\
&=\frac{1}{\\#\Omega}\sum_{b=1}^{N}\mu(b)\left(\frac{N^{2}}{b}+O(N)\right)^{d-1}\sum_{\begin{subarray}{c}0\leq
v_{j},w_{j}\leq N\\\
b|(v_{j}-w_{j})\end{subarray}}(w_{j}-v_{j})^{2}.\end{split}$ (4.5)

In the interior sum from (4.5) we group the terms with $v_{j}$ and $w_{j}$ in
the same residue classes mod $b$ as follows:

$\begin{split}\sum_{\begin{subarray}{c}0\leq v_{j},w_{j}\leq N\\\
b|(v_{j}-w_{j})\end{subarray}}(w_{j}-v_{j})^{2}&=\sum_{r=0}^{b-1}\sum_{\begin{subarray}{c}0\leq
v_{j},w_{j}\leq N\\\ v_{j}\equiv w_{j}\equiv
r\left(\mathrm{mod\;}b\right)\end{subarray}}(w_{j}-v_{j})^{2}\\\
&=\sum_{r=0}^{b-1}\sum_{m=0}^{\left\lfloor\frac{N-r}{b}\right\rfloor}\sum_{n=0}^{\left\lfloor\frac{N-r}{b}\right\rfloor}\big{(}(r+mb)-(r+nb)\big{)}^{2}\\\
&=b^{2}\sum_{r=0}^{b-1}\sum_{m=0}^{\left\lfloor\frac{N-r}{b}\right\rfloor}\sum_{n=0}^{\left\lfloor\frac{N-r}{b}\right\rfloor}(m-n)^{2}.\end{split}$
(4.6)

With $M=\left\lfloor\frac{N-r}{b}\right\rfloor$, the sums over $m$ and $n$ are
equal to

$\begin{split}\sum_{m=0}^{M}\sum_{n=0}^{M}(m-n)^{2}&=2\sum_{m=0}^{M}\sum_{n=0}^{M}m^{2}-2\sum_{m=0}^{M}\sum_{n=0}^{M}mn\\\
&=2\left(\frac{1}{3}M^{4}+O(M^{3})\right)-2\left(\frac{1}{4}M^{4}+O(M^{3})\right)\\\
&=\left(\frac{1}{6}M^{4}+O(M^{3})\right).\end{split}$ (4.7)

Combining (4.7) into (4.6) we find that

$\begin{split}\sum_{\begin{subarray}{c}0\leq v_{j},w_{j}\leq N\\\
b|(v_{j}-w_{j})\end{subarray}}(w_{j}-v_{j})^{2}&=\frac{N^{4}}{6b}+O(N^{3}).\end{split}$
(4.8)

On inserting this estimate in (4.5), we obtain

$\begin{split}H_{j}&=\frac{1}{\\#\Omega}\sum_{b=1}^{N}\mu(b)\left(\frac{N^{2}}{b}+O(N)\right)^{d-1}\left(\frac{N^{4}}{6b}+O(N^{3})\right)\\\
&=\frac{N^{2d+2}}{6\cdot\\#\Omega}\sum_{b=1}^{N}\frac{\mu(b)}{b^{d}}\left(1+O\bigg{(}\frac{b}{N}\bigg{)}\right)^{d}\\\
&=\frac{N^{2d+2}}{6\cdot\\#\Omega}\left(\frac{1}{\zeta(d)}+O\bigg{(}\frac{1}{dN^{d-1}}\bigg{)}+\sum_{b=1}^{N}\frac{1}{b^{d}}\sum_{k=1}^{d}\binom{d}{k}\bigg{(}\frac{b}{N}\bigg{)}^{k}\right).\end{split}$
(4.9)

Here the interior sums are

$\begin{split}\sum_{b=1}^{N}\frac{1}{b^{d}}\sum_{k=1}^{d}\binom{d}{k}\bigg{(}\frac{b}{N}\bigg{)}^{k}=\begin{cases}O\left(\frac{\log
N}{N}\right)&\text{ if $d=2$},\\\\[8.0pt] O\left(\frac{d}{N}\right)&\text{ if
$d\geq 3$}.\end{cases}\end{split}$

Introducing this estimate in (4.9) and the result in (4.3) we summarize in the
next lemma the estimate obtained for $A_{vis}(d,N)$.

######  Lemma 4.1.

We have

$A_{vis}(d,N)=\begin{cases}\frac{dN^{2d+2}}{6\\#\Omega\zeta(d)}\left(1+O\left(\frac{\log
N}{N}\right)\right)&\text{ if $d=2$},\\\\[8.0pt]
\frac{dN^{2d+2}}{6\\#\Omega\zeta(d)}\left(1+O\left(\frac{d}{N}\right)\right)&\text{
if $d\geq 3$}.\end{cases}$ (4.10)

Taking into account the size of the cardinality of $\Omega$ evaluated in Lemma
3.1 into (4.10), it yields the following simple estimate for $A_{vis}(d,N)$.

######  Lemma 4.2.

There exists an absolute constant $C_{1}>0$, such that for all $d\geq 2$ and
all $N\geq 3d$, we have

$\left|A_{vis}(d,N)-\frac{dN^{2}}{6}\right|\leq\begin{cases}C_{1}N\log
N&\text{ if $d=2$},\\\\[8.0pt] C_{1}d^{2}N&\text{ if $d\geq 3$}.\end{cases}$
(4.11)

##  5\. The second moment about the mean

The second moment about the mean $A_{vis}(d,N)$ is the average of the squares
of the differences between the expected and the true distance between the
pairs of points from $\mathcal{W}$ that are visible from each other, that is,

$\begin{split}\mathfrak{M}_{2,vis}(d,N):=\frac{1}{\\#\Omega}\sum_{\bm{v}\in\mathcal{W}}\sum_{\begin{subarray}{c}\bm{w}\in\mathcal{W}\\\
(\bm{v},\bm{w})\in\Omega\end{subarray}}\left|\operatorname{\mathfrak{d}}^{2}(\bm{v},\bm{w})-A_{vis}(d,N)\right|^{2}.\end{split}$
(5.1)

Replacing the coprimality condition by means of the characteristic function
(3.1) and changing the order of summation, we have

$\begin{split}\mathfrak{M}_{2,vis}(d,N)=&\frac{1}{\\#\Omega}\sum_{b=1}^{N}\mu(b)\sum_{\bm{v}\in\mathcal{W}}\sum_{\begin{subarray}{c}\bm{w}\in\mathcal{W}\\\
b|(v_{1}-w_{1})\\\ \cdots\\\
b|(v_{d}-w_{d})\end{subarray}}\left|\operatorname{\mathfrak{d}}^{2}(\bm{v},\bm{w})-A_{vis}(d,N)\right|^{2}.\end{split}$

Next, by expanding the square it yields

$\begin{split}\mathfrak{M}_{2,vis}(d,N)=&\frac{1}{\\#\Omega}\sum_{b=1}^{N}\mu(b)\sum_{\bm{v}\in\mathcal{W}}\sum_{\begin{subarray}{c}\bm{w}\in\mathcal{W}\\\
b|(v_{1}-w_{1})\\\ \cdots\\\
b|(v_{d}-w_{d})\end{subarray}}\operatorname{\mathfrak{d}}^{4}(\bm{v},\bm{w})\\\
&-\frac{2A_{vis}(d,N)}{\\#\Omega}\sum_{b=1}^{N}\mu(b)\sum_{\bm{v}\in\mathcal{W}}\sum_{\begin{subarray}{c}\bm{w}\in\mathcal{W}\\\
b|(v_{1}-w_{1})\\\ \cdots\\\
b|(v_{d}-w_{d})\end{subarray}}\operatorname{\mathfrak{d}}^{2}(\bm{v},\bm{w})\\\
&+\frac{A^{2}_{vis}(d,N)}{\\#\Omega}\sum_{b=1}^{N}\mu(b)\sum_{\bm{v}\in\mathcal{W}}\sum_{\begin{subarray}{c}\bm{w}\in\mathcal{W}\\\
b|(v_{1}-w_{1})\\\ \cdots\\\ b|(v_{d}-w_{d})\end{subarray}}1\\\
=&\frac{1}{\\#\Omega}\cdot\Sigma_{vis}-A^{2}_{vis}(d,N).\end{split}$ (5.2)

Here we have denoted by $\Sigma_{vis}$ the multiple sum over $\bm{v}$ and
$\bm{w}$ from the first row of relation (5.2) and have taken into account the
fact that the term from the second row is equal to $-2A^{2}_{vis}(d,N)$, while
the term from the third row is equal to $A^{2}_{vis}(d,N)$. Next, changing the
order of summation, we split $\Sigma_{vis}$ into $d^{2}$ similar sums
$H_{j,k}$

$\begin{split}\Sigma_{vis}&=\sum_{b=1}^{N}\mu(b)\sum_{\bm{v}\in\mathcal{W}}\sum_{\begin{subarray}{c}\bm{w}\in\mathcal{W}\\\
b|(v_{1}-w_{1})\\\ \cdots\\\
b|(v_{d}-w_{d})\end{subarray}}\sum_{j=1}^{d}\sum_{k=1}^{d}(w_{j}-v_{j})^{2}(w_{k}-v_{k})^{2}=\sum_{j=1}^{d}\sum_{k=1}^{d}H_{j,k},\end{split}$
(5.3)

where

$\begin{split}H_{j,k}&=\sum_{b=1}^{N}\mu(b)\sum_{\bm{v}\in\mathcal{W}}\sum_{\begin{subarray}{c}\bm{w}\in\mathcal{W}\\\
b|(v_{1}-w_{1})\\\ \cdots\\\
b|(v_{d}-w_{d})\end{subarray}}(w_{j}-v_{j})^{2}(w_{k}-v_{k})^{2}.\end{split}$
(5.4)

Now fix $j\neq k$. In each $H_{j,k}$ the summand depends only on four of the
$2d$ variables $v_{1},\dots,v_{d},w_{1},\dots,w_{d}$, so that

$\begin{split}H_{j,k}&=\sum_{b=1}^{N}\mu(b)\bigg{(}\sum_{\begin{subarray}{c}0\leq
v_{j},w_{j}\leq N\\\
b|(v_{j}-w_{j})\end{subarray}}\sum_{\begin{subarray}{c}0\leq v_{k},w_{k}\leq
N\\\
b|(v_{k}-w_{k})\end{subarray}}(w_{j}-v_{j})^{2}(w_{k}-v_{k})^{2}\bigg{)}\prod_{\begin{subarray}{c}s=1\\\
s\not=j\\\ s\not=k\end{subarray}}^{d}\bigg{(}\sum_{\begin{subarray}{c}0\leq
v_{s},w_{s}\leq N\\\ b|(v_{s}-w_{s})\end{subarray}}1\bigg{)}.\end{split}$
(5.5)

Since the products count the number of terms in some arithmetic progressions
and are equal, we derive that

$\begin{split}H_{j,k}&=\sum_{b=1}^{N}\mu(b)\left(\frac{N^{2}}{b}+O(N)\right)^{d-2}\sum_{\begin{subarray}{c}0\leq
v_{j},w_{j}\leq N\\\
b|(v_{j}-w_{j})\end{subarray}}\sum_{\begin{subarray}{c}0\leq v_{k},w_{k}\leq
N\\\
b|(v_{k}-w_{k})\end{subarray}}(w_{j}-v_{j})^{2}(w_{k}-v_{k})^{2}\end{split}$
(5.6)

By relation (4.8), we find that the interior sums are

$\begin{split}\sum_{\begin{subarray}{c}0\leq v_{j},w_{j}\leq N\\\
b|(v_{j}-w_{j})\end{subarray}}\sum_{\begin{subarray}{c}0\leq v_{k},w_{k}\leq
N\\\
b|(v_{k}-w_{k})\end{subarray}}(w_{j}-v_{j})^{2}(w_{k}-v_{k})^{2}=\frac{N^{8}}{36b^{2}}+O\left(N^{7}/b\right).\end{split}$
(5.7)

On combining (5.7) and (5.6), it follows that

$\begin{split}H_{j,k}&=\sum_{b=1}^{N}\mu(b)\left(\frac{N^{2}}{b}+O(N)\right)^{d-2}\left(\frac{N^{8}}{36b^{2}}+O\left(N^{7}/b\right)\right)\\\
&=\frac{N^{2d+4}}{36}\sum_{b=1}^{N}\frac{\mu(b)}{b^{d}}\left(1+O\bigg{(}\frac{b}{N}\bigg{)}\right)^{d}.\end{split}$
(5.8)

Following the reasoning from (4.9) and the relation that follows, we obtain
the following estimate

$\begin{split}H_{j,k}=\begin{cases}\frac{N^{2d+4}}{36\zeta(d)}\left(1+O\left(\frac{\log
N}{N}\right)\right)&\text{ if $d=2$},\\\\[8.0pt]
\frac{N^{2d+4}}{36\zeta(d)}\left(1+O\left(\frac{d}{N}\right)\right)&\text{ if
$d\geq 3$}.\end{cases}\end{split}$ (5.9)

If $j=k$, adapting the same steps after relation (5.4) we obtain the upper
bound

$\begin{split}H_{j,j}=O(N^{2d+4}),\text{ for $1\leq j\leq d$.}\end{split}$
(5.10)

Then on inserting (5.10) and (5.9) into (5.3), yields

$\begin{split}\Sigma_{vis}=\frac{d^{2}N^{2d+4}}{36\zeta(d)}\left(1+O\left(\frac{1}{d}+\frac{d}{N}\right)\right).\end{split}$
(5.11)

On combining (5.11), (5.2), Lemma 3.1 and Lemma 4.2, we obtain the following
result.

######  Lemma 5.1.

There exists an absolute constant $C_{2}>0$, such that for all $d\geq 2$ and
all $N\geq 3d$, we have

$\mathfrak{M}_{2,vis}(d,N)\leq C_{2}(dN^{4}+d^{3}N^{3}).$ (5.12)

##  6\. Effective results and the proofs of Theorems 1, 3 and Corollary 1

We scale the bound for $\mathfrak{M}_{2,vis}(d,N)$ from Lemma 5.1 by
$d^{2}N^{4}$, in order to have all spacings between points measured by the
normalized distance situated in the interval $[0,1]$. Note first that for any
$d\geq 2$ and any $N\geq 3d$, we have

$\frac{\mathfrak{M}_{2,vis}(d,N)}{d^{2}N^{4}}\leq
C_{2}\left(\frac{1}{d}+\frac{d}{N}\right).$

Then, on combining the above inequalities with Lemma 4.2, there is an absolute
constant $C_{3}>0$ such that

$\frac{1}{\\#\Omega}\sum_{(\bm{v},\bm{w})\in\Omega}\left(\operatorname{\mathfrak{d}}_{d}^{2}(\bm{v},\bm{w})-\mbox{\small$\displaystyle\frac{1}{6}$}\right)^{2}\leq
C_{3}\left(\frac{1}{d}+\frac{d}{N}\right).$ (6.1)

Now, for any parameters $a,T>0$, imposing supplementary conditions on the
summation, we find the following lower bounds of the left-side term of the
inequality (6.1):

$\begin{split}\frac{1}{\\#\Omega}\sum_{(\bm{v},\bm{w})\in\Omega}\left(\operatorname{\mathfrak{d}}_{d}^{2}(\bm{v},\bm{w})-\mbox{\small$\displaystyle\frac{1}{6}$}\right)^{2}&\geq\frac{1}{\\#\Omega}\sum_{\begin{subarray}{c}(\bm{v},\bm{w})\in\Omega\\\
\big{|}\operatorname{\mathfrak{d}}_{d}^{2}(\bm{v},\bm{w})-\frac{1}{6}\big{|}\geq\frac{1}{aT}\end{subarray}}\left(\operatorname{\mathfrak{d}}_{d}^{2}(\bm{v},\bm{w})-\mbox{\small$\displaystyle\frac{1}{6}$}\right)^{2}\\\
&\geq\frac{1}{\\#\Omega}\sum_{\begin{subarray}{c}(\bm{v},\bm{w})\in\Omega\\\
\big{|}\operatorname{\mathfrak{d}}_{d}^{2}(\bm{v},\bm{w})-\frac{1}{6}\big{|}\geq\frac{1}{aT}\end{subarray}}\frac{1}{a^{2}T^{2}}.\end{split}$
(6.2)

Then, on combining (6.1) and (6.2), we find that

$\frac{1}{\\#\Omega}\\#\left\\{(\bm{v},\bm{w})\in\Omega\;:\;\left|\operatorname{\mathfrak{d}}_{d}^{2}(\bm{v},\bm{w})-\frac{1}{6}\right|\geq\frac{1}{aT}\right\\}\leq
C_{3}a^{2}T^{2}\left(\frac{1}{d}+\frac{d}{N}\right).$ (6.3)

Now, since

$\left|\operatorname{\mathfrak{d}}_{d}^{2}(\bm{v},\bm{w})-\frac{1}{6}\right|=\left|\operatorname{\mathfrak{d}}_{d}(\bm{v},\bm{w})-\frac{1}{\sqrt{6}}\right|\left(\operatorname{\mathfrak{d}}_{d}(\bm{v},\bm{w})+\frac{1}{\sqrt{6}}\right)\geq\frac{1}{\sqrt{6}}\left|\operatorname{\mathfrak{d}}_{d}(\bm{v},\bm{w})-\frac{1}{\sqrt{6}}\right|,$

by sharpening the restriction in the definition of the set on the left side of
(6.3), the set remains with fewer elements, so that with $a=\sqrt{6}$, we
derive that

$\frac{1}{\\#\Omega}\\#\left\\{(\bm{v},\bm{w})\in\Omega\;:\;\left|\operatorname{\mathfrak{d}}_{d}(\bm{v},\bm{w})-\frac{1}{\sqrt{6}}\right|\geq\frac{1}{T}\right\\}\leq
6C_{3}T^{2}\left(\frac{1}{d}+\frac{d}{N}\right).$ (6.4)

In particular, this proves Theorem 1.

More generally, we consider the set $\Omega_{K}$ of $K$-polytopes
$P=\\{\bm{w}_{1},\dots,\bm{w}_{K}\\}\subset\mathcal{W}$ the property that any
of its two vertices are visible from each other. Then Corollary 1 follows from
the following more general statements.

######  Theorem 5.

There exists an effectively computable absolute constant $C_{4}>0$ such that
for any integers $d\geq 2$, $N\geq 3d$, $K\geq 2$ and any real $T>0$, we have

$\mbox{\small$\displaystyle\frac{1}{\\#\Omega_{K}}$}\cdot\\#\left\\{\\{\bm{w}_{1},\dots,\bm{w}_{K}\\}\subset\Omega_{K}\;:\;\max_{1\leq
m\not=n\leq
K}\left|\operatorname{\mathfrak{d}}_{d}(\bm{w}_{m},\bm{w}_{n})-\mbox{\small$\displaystyle\frac{1}{\sqrt{6}}$}\right|\geq\mbox{\small$\displaystyle\frac{1}{T}$}\right\\}\leq
C_{4}T^{2}K^{2}\left(\frac{1}{d}+\frac{d}{N}\right).$

######  Corollary 2.

Let $\eta\in(0,1/4)$ be fixed. Then, there exists an effectively computable
absolute constant $C_{5}>0$ such that for any integers $d\geq 2$, $N\geq
d^{2}$, $2\leq K\leq d^{1/2-2\eta}$, we have

$\mbox{\small$\displaystyle\frac{1}{\\#\Omega_{K}}$}\cdot\\#\left\\{\\{\bm{w}_{1},\dots,\bm{w}_{K}\\}\subset\Omega_{K}\;:\;\left.\begin{aligned}
&\operatorname{\mathfrak{d}}_{d}(\bm{w}_{m},\bm{w}_{n})\in\left[\mbox{\small$\displaystyle\frac{1}{\sqrt{6}}$}-\mbox{\small$\displaystyle\frac{1}{d^{\eta}}$},\mbox{\small$\displaystyle\frac{1}{\sqrt{6}}$}+\mbox{\small$\displaystyle\frac{1}{d^{\eta}}$}\right]\\\
&\text{ for all $1\leq m\not=n\leq K$ }\end{aligned}\right.\right\\}\geq
1-\mbox{\small$\displaystyle\frac{C_{5}}{d^{2\eta}}$}.$

For the proof of Theorem 3 one can follow the path from Sections 4 and 5 with
one component $\bm{v}=\mathbf{0}$ fixed in the involved summations. One finds
that almost all normalized distances between the origin and the components of
points in $\Omega$ are close to $1/\sqrt{3}$.

On the other hand, we know that, according to Theorem 1, almost all normalized
distances between $\bm{v}$ and $\bm{w}$ with $(\bm{v},\bm{w})\in\Omega$ are
almost always almost equal to $1/\sqrt{6}$. Therefore, almost all triangles
with vertices $\mathbf{0},\bm{v},\bm{w}$ with $(\bm{v},\bm{w})\in\Omega$ are
almost isosceles having the normalized edges almost equal to
$1/\sqrt{3},1/\sqrt{3},1/\sqrt{6}$ and Theorem 3 follows immediately.

##  7\. The probability that a $K$-polytope is Self-Visible

Let $K\geq 2$ be a fixed integer. The set of self-visible $K$-polytopes with
vertices in the lattice $\mathcal{W}$ is

$\Omega_{K}=\left\\{P\in\mathcal{W}^{K}\;:\;\bm{v}^{\prime},\bm{v}^{\prime\prime}\text{
visible from each other, for all }\bm{v}^{\prime},\bm{v}^{\prime\prime}\in
P\right\\}.$ (7.1)

Our object here is to see if there is a tendency of the probabilities that a
$K$-polytope is self-visible as $N$ gets large. We show that if $d$ and $K$
are kept fixed, the limit of the ratios

$Prob(d,N,K)=\lim_{N\to\infty}\frac{\\#\Omega_{K}}{\\#\mathcal{W}^{K}}$

does exist.

If $K=2$, then $\Omega_{K}$ coincides with $\Omega$, but the Möbius summation
method used in the proof of Lemma 3.1 to estimate $\\#\Omega_{2}$ is not
suitable for larger $K$, because of the size of the multitude of new terms
introduced. We need to have a better control on the large divisors, so we will
proceed accordingly.

Denote a generic polytope by $P=\\{\bm{v}_{1},\dots,\bm{v}_{K}\\}$ and the
coordinates of its vertices by $\bm{v}_{j}=(v_{j,1},\dots,v_{j,d})$ for $1\leq
j\leq K$. Note that, for each positive integer $m$, we have the following
inequality

$\\#\left\\{(\bm{v}_{j},\bm{v}_{k})\in\mathcal{W}^{2}\;:\;\bm{v}_{j}\neq\bm{v}_{k},\
m\mid\gcd(v_{j,1}-v_{k,1},\dots,v_{j,d}-v_{k,d})\right\\}\leq\frac{\\#\mathcal{W}^{2}}{m^{d}},$
(7.2)

because, say, $v_{j,1},\dots,v_{j,d}$ are free and then each of
$v_{k,1},\dots,v_{k,d}$ belongs to the corresponding shifted arithmetic
progression of ratio $m$. Also, if $m\geq N$, the left side of (7.2) equals
zero, since there are no pairs to count.

Fix $M>0$, a parameter to be chosen later, and sum the inequalities (7.2) for
all $m>M$. Then the size of the resulted sum is

$\leq\sum_{m>M}\frac{\\#\mathcal{W}^{2}}{m^{d}}=O\left(\frac{\\#\mathcal{W}^{2}}{M^{d-1}}\right).$

As a consequence, any such subsum is also $\ll\\#\mathcal{W}^{2}/M^{d-1}$. In
particular, the sum over all positive integers $m$ that have at least one
prime factor larger than $M$. This holds for each pair
$(\bm{v}_{j},\bm{v}_{k})$, and there are $K(K-1)/2$ such pairs with $1\leq
j<k\leq K$. As a consequence, it follows that

$\\#\left\\{(\bm{v}_{1},\dots,\bm{v}_{K})\in\mathcal{W}^{K}\;:\;\left.\begin{aligned}
&q\mid\gcd(v_{j,1}-v_{k,1},\dots,v_{j,d}-v_{k,d})\\\ &\text{ for some prime
$q>M$,}\\\ &\text{ for some $1\leq j<k\leq K$
}\end{aligned}\right.\right\\}\ll\frac{K^{2}\\#\mathcal{W}^{K}}{M^{d-1}}.$
(7.3)

In other words, with the exception of at most
$O\left(\frac{K^{2}\\#\mathcal{W}^{K}}{M^{d-1}}\right)$ $K$-tuples
$(\bm{v}_{1},\dots,\bm{v}_{K})$, for all the other polytopes
$P=(\bm{v}_{1},\dots,\bm{v}_{K})\in\mathcal{W}^{K}$, the condition
$P\in\Omega_{K}$ is equivalent to the condition that $P\in\Omega_{K}(M)$,
where

$\Omega_{K}(M):=\left\\{(\bm{v}_{1},\dots,\bm{v}_{K})\in\mathcal{W}^{K}\;:\;\left.\begin{aligned}
&\gcd(B,v_{j,1}-v_{k,1},\dots,v_{j,d}-v_{k,d})=1\\\ &\text{ for all $1\leq
j<k\leq K$ }\end{aligned}\right.\right\\},$ (7.4)

where $B$ is the primorial number

$B:=\prod\limits_{\begin{subarray}{c}\text{$p$ prime}\\\ p\leq
M\end{subarray}}p.$

Therefore, the probability that a polytope $P\in\mathcal{W}^{K}$ has all
vertices visible from each other is

$\frac{\\#\Omega_{K}}{\\#\mathcal{W}^{K}}=\frac{\\#\Omega_{K}(M)}{\\#\mathcal{W}^{K}}+O\left(\frac{K^{2}\\#\mathcal{W}^{K}}{M^{d-1}}\right).$
(7.5)

By the Prime Number Theorem, we know that $B=e^{(1+o(1))M}$, so that we will
eventually choose $M$ of size $\log N$ to assure that $B<N$.

Next, we split the interval $[0,N]$ in subintervals of size $B$. Accordingly,
the cube $[0,N]^{d}$ is split in boxes of side length $B$. The number of these
boxes is

$\text{The number of
boxes}=\left(\frac{N}{B}+O(1)\right)^{d}=\frac{N^{d}}{B^{d}}+O\left(\frac{dN^{d-1}}{B^{d-1}}\right).$
(7.6)

Observe, by the definition, that $\Omega_{K}(M)$ has the same number of
elements in each such box. Denote this number by $H(B)$, that is,

$H(B):=\\#\left\\{(\bm{v}_{1},\dots,\bm{v}_{K})\in\Omega_{K}(M)\;:\;0\leq
v_{j,l}<B\text{ for all $1\leq j\leq K$, $1\leq l\leq d$}\right\\}.$ (7.7)

Then, by (7.6) and (7.7), as each $\bm{v}_{1},\dots,\bm{v}_{K}$ runs over each
box, it follows that

$\\#\Omega_{K}(M)=H(B)\left(\frac{N^{d}}{B^{d}}+O\left(\frac{dN^{d-1}}{B^{d-1}}\right)\right)^{K}=\frac{N^{dK}H(B)}{B^{dK}}\left(1+O\left(\frac{dKB}{N}\right)\right).$
(7.8)

Since $H(B)\leq B^{dK}$ and since
$\\#\mathcal{W}^{K}=(N+1)^{dK}=N^{dK}(1+O(dK/N))$, it follows that

$\frac{\\#\Omega_{K}(M)}{\\#\mathcal{W}^{K}}=\frac{H(B)}{B^{dK}}\left(1+O\left(\frac{dKB}{N}\right)\right)=\frac{H(B)}{B^{dK}}+O\left(\frac{dKB}{N}\right).$
(7.9)

On combining (7.8) and (7.5), it yields

$\frac{\\#\Omega_{K}}{\\#\mathcal{W}^{K}}=\frac{H(B)}{B^{dK}}+O\left(\frac{dKB}{N}\right)+O\left(\frac{K^{2}}{M^{d-1}}\right).$
(7.10)

Now, for each prime $p\mid B$, consider the analogue of the set
$\Omega_{K}(M)$ defined by (7.4). Its cardinality is analogous to $H(B)$ and
is given by

$H(p):=\\#\left\\{(\bm{v}_{1},\dots,\bm{v}_{K})\in\mathcal{W}^{K}:\left.\begin{aligned}
&\gcd(p,v_{j,1}-v_{k,1},\dots,v_{j,d}-v_{k,d})=1\\\ &\text{ for all $1\leq
j<k\leq K$, }\\\ &0\leq v_{j,l}\leq p-1\text{ for all $1\leq j\leq K$, $1\leq
l\leq d$}\end{aligned}\right.\right\\}.$ (7.11)

Note that each $(\bm{v}_{1},\dots,\bm{v}_{K})\in\mathcal{W}^{K}$ that
contributes to $H(B)$ produces, via reduction modulo $p$, a $K$-tuple that
contributes to $H(p)$, and this holds for each prime divisor $p$ of $B$.
Conversely, by the Chinese Remainder Theorem, each collection of $K$-tuples,
with one $K$-tuple for each prime divisor of $B$, produces a unique $K$-tuple
that is counted in $H(B)$. In conclusion,

$H(B)=\prod_{\begin{subarray}{c}\text{$p$ prime}\\\ p\mid
B\end{subarray}}H(p)=\prod_{\begin{subarray}{c}\text{$p$ prime}\\\ p\leq
M\end{subarray}}H(p),$

which combined with (7.10) implies

$\frac{\\#\Omega_{K}}{\\#\mathcal{W}^{K}}=\prod_{\begin{subarray}{c}\text{$p$
prime}\\\ p\leq
M\end{subarray}}\frac{H(p)}{p^{dK}}+O\left(\frac{dKB}{N}\right)+O\left(\frac{K^{2}}{M^{d-1}}\right).$
(7.12)

Next, let us observe that since each of the coordinates
$v_{j,1},\dots,v_{j,d}$ and $v_{k,1},\dots,v_{k,d}$ belongs to
$\\{0,1,\dots,p-1\\}$, the difference $v_{j,1}-v_{k,1}$ cannot be divisible by
$p$ unless $v_{j,1}=v_{k,1}$, and similarly for all differences
$v_{j,2}-v_{k,2},\dots,v_{j,d}-v_{k,d}$. As a consequence, the condition
$\gcd(p,v_{j,1}-v_{k,1},\dots,v_{j,d}-v_{k,d})=1$ from the definition of
$H(p)$ given by (7.11) is equivalent to the condition that the $d$-tuples
$(v_{j,1},\dots,v_{j,d})$ and $(v_{k,1},\dots,v_{k,d})$ are distinct. In other
words

$H(p)=\\#\left\\{(\bm{v}_{1},\dots,\bm{v}_{K})\in\mathcal{W}^{K}\;:\;\left.\begin{aligned}
&\mbox{}\bm{v}_{j}\neq\bm{v}_{k}\text{ for $1\leq j\neq k\leq K$,}\\\ &0\leq
v_{j,l}\leq p-1\text{ for all $1\leq j\leq K$ and $1\leq l\leq d$
}\end{aligned}\right.\right\\}.$

Here, there are exactly $p^{d}$ choices for $\bm{v}_{1}$. Then, for each fixed
$\bm{v}_{1}$, the only restriction on $\bm{v}_{2}$ is to not coincide with
$\bm{v}_{1}$, so that there are $p^{d}-1$ choices for $\bm{v}_{2}$. With
$\bm{v}_{1}$ and $\bm{v}_{2}$ fixed, the only restrictions on $\bm{v}_{3}$ are
$\bm{v}_{3}\neq\bm{v}_{1}$ and $\bm{v}_{3}\neq\bm{v}_{2}$, so that there are
$p^{d}-2$ choices for $\bm{v}_{3}$. And so on, up to $\bm{v}_{K}$, for which
there are $p^{d}-(K-1)$ choices. In conclusion

$H(p)=p^{d}\left(p^{d}-1\right)\cdots\left(p^{d}-(K-1)\right).$

On combining this with (7.12) we see that

$\frac{\\#\Omega_{K}}{\\#\mathcal{W}^{K}}=\prod_{\begin{subarray}{c}\text{$p$
prime}\\\ p\leq
M\end{subarray}}\left(1-\frac{1}{p^{d}}\right)\cdots\left(1-\frac{K-1}{p^{d}}\right)+O\left(\frac{dKB}{N}\right)+O\left(\frac{K^{2}}{M^{d-1}}\right).$
(7.13)

The finite product over primes in (7.13) can be replaced with the completed
product over all primes, with a change in the error term that is swallowed
inside the last error term. Indeed, if we denote

$\Lambda_{d,K}(M):=\prod_{\begin{subarray}{c}\text{$p$ prime}\\\
p>M\end{subarray}}\left(1-\frac{1}{p^{d}}\right)\cdots\left(1-\frac{K-1}{p^{d}}\right),$

an infinite product that converges if $d\geq 2$, then

$\log\Lambda_{d,K}(M)=\sum_{\begin{subarray}{c}\text{$p$ prime}\\\
p>M\end{subarray}}\sum_{1\leq k\leq
K-1}\log\left(1-\frac{k}{p^{d}}\right)=\sum_{\begin{subarray}{c}\text{$p$
prime}\\\ p>M\end{subarray}}\sum_{1\leq k\leq
K-1}O\left(\frac{k}{p^{d}}\right).$

This implies

$\begin{split}|\log\Lambda_{d,K}(M)|&=O\bigg{(}\sum_{\begin{subarray}{c}\text{$p$
prime}\\\ p>M\end{subarray}}\sum_{1\leq k\leq
K-1}\frac{k}{p^{d}}\bigg{)}=O\bigg{(}\sum_{\begin{subarray}{c}\text{$p$
prime}\\\
p>M\end{subarray}}\frac{K^{2}}{p^{d}}\bigg{)}=O\bigg{(}\sum_{m>M}\frac{K^{2}}{m^{d}}\bigg{)}=O\left(\frac{K^{2}}{M^{d-1}}\right).\end{split}$

It follows that

$\Lambda_{d,K}(M)=\exp\left(O\left(\mbox{\small$\displaystyle\frac{K^{2}}{M^{d-1}}$}\right)\right)=1+O\left(\mbox{\small$\displaystyle\frac{K^{2}}{M^{d-1}}$}\right).$

Therefore, if we denote by $\Lambda_{d,K}$ the complete infinite product,

$\Lambda_{d,K}:=\prod_{\text{$p$
prime}}\left(1-\mbox{\small$\displaystyle\frac{1}{p^{d}}$}\right)\cdots\left(1-\mbox{\small$\displaystyle\frac{K-1}{p^{d}}$}\right),$
(7.14)

which is constant for any fixed $d$ and $K$, we have

$\begin{split}\prod_{\begin{subarray}{c}\text{$p$ prime}\\\ p\leq
M\end{subarray}}\left(1-\mbox{\small$\displaystyle\frac{1}{p^{d}}$}\right)\cdots\left(1-\mbox{\small$\displaystyle\frac{K-1}{p^{d}}$}\right)&=\frac{\Lambda_{d,K}}{\Lambda_{d,K}(M)}=\Lambda_{d,K}+O\left(\mbox{\small$\displaystyle\frac{K^{2}}{M^{d-1}}$}\right),\end{split}$
(7.15)

where the implied constant in the big $O$ estimate is absolute, because
$\Lambda_{d,2}=\zeta(d)^{-1}$ for $d\geq 2$ and, for any fixed $d$, the
sequence $\\{\Lambda_{d,K}\\}_{K\geq 2}$ is decreasing.

Then, inserting (7.15) and (7.14) in (7.13), we arrive at the following result

$\frac{\\#\Omega_{K}}{\\#\mathcal{W}^{K}}=\prod_{\begin{subarray}{c}\text{$p$
prime}\end{subarray}}\left(1-\frac{1}{p^{d}}\right)\cdots\left(1-\frac{K-1}{p^{d}}\right)+O\left(\frac{dKB}{N}\right)+O\left(\frac{K^{2}}{M^{d-1}}\right).$

We now take $B$ to be the largest primorial that is $\leq\sqrt{N}$, which
means that $M\sim(\log N)/2$. Then,

$\frac{\\#\Omega_{K}}{\\#\mathcal{W}^{K}}=\prod_{\begin{subarray}{c}\text{$p$
prime}\end{subarray}}\left(1-\frac{1}{p^{d}}\right)\cdots\left(1-\frac{K-1}{p^{d}}\right)+O\left(\frac{dK}{\sqrt{N}}\right)+O\left(\frac{2^{d}K^{2}}{\log^{d-1}N}\right),$
(7.16)

and the constants implied in the big $O$ terms are absolute. This concludes
the proof of Theorem 2.

##  8\. Probabilistic Intuition

In this section, we show how to interpret the constant $1/\sqrt{6}$ in Theorem
1 via probabilistic intuition. Similar arguments can give intuition for some
of the other particular constants we obtain in this paper. We recall

$\operatorname{\mathfrak{d}}_{d}(\bm{v},\bm{w})=\frac{1}{Nd^{1/2}}\bigg{(}\sum_{n=1}^{d}(w_{n}-v_{n})^{2}\bigg{)}^{1/2}=\left(\frac{1}{d}\sum_{n=1}^{d}\left(\frac{w_{n}}{N}-\frac{v_{n}}{N}\right)^{2}\right)^{1/2},$

As $N\rightarrow\infty$, if we select $\bm{v}$ uniformly at random from
$\mathcal{W}$ (or, indeed, the subset of integer vectors visible from the
origin in $\mathcal{W}$), the normalized vector $\bm{v}/N$ becomes
equidistributed in the hypercube $[0,1]^{d}$. That is,

$\sum_{\bm{v}\in\mathcal{W}}\delta_{\bm{v}/N}\rightarrow m,$

where $m$ is the standard Lebesgue measure on $[0,1]^{d}$, and the convergence
is in the weak*-sense as $N\rightarrow\infty$. The same result is true with
$\mathcal{W}$ replaced by the subset of primitive vectors in $\mathcal{W}$.
Thus, to try and get intuition about the $d\rightarrow\infty$ behavior of our
normalized distance $\operatorname{\mathfrak{d}}_{d}(\bm{v},\bm{w})$, we can
consider the following probabilistic analogue. Let $\mathbf{X}=(X_{1},\ldots
X_{d}),\mathbf{Y}=(Y_{1},\ldots,Y_{d})$ be independent random vectors chosen
according to Lebesgue measure on the hypercube $[0,1]^{d}$. Thus
$X_{1},\ldots,X_{d}$ and $Y_{1},\ldots Y_{d}$ are independent, identically
distributed (i.i.d.) uniform $[0,1]$ random variables, and also indpendent
from each other. We define

$\operatorname{\mathfrak{d}}_{d}(\mathbf{X},\mathbf{Y})=\left(\frac{1}{d}\sum_{n=1}^{d}\left(X_{n}-Y_{n}\right)^{2}\right)^{1/2}.$

Thus

$\operatorname{\mathfrak{d}}_{d}^{2}(\mathbf{X},\mathbf{Y})=\frac{1}{d}\sum_{n=1}^{d}\left(X_{n}-Y_{n}\right)^{2}$

is the sample mean of $d$ independent random variables of the form
$(U-V)^{2}$, where $U$ and $V$ are independent uniform $[0,1]$ random
variables. By the strong law of large numbers, as $d\rightarrow\infty$, this
converges with probability $1$ to the mean

$E((U-V)^{2})=\int_{0}^{1}\int_{0}^{1}(u-v)^{2}dudv=1/6.$

That is, as $d\rightarrow\infty,$ with probability $1$,

$\operatorname{\mathfrak{d}}_{d}^{2}(\mathbf{X},\mathbf{Y})\rightarrow 1/6,$

so

$\operatorname{\mathfrak{d}}_{d}(\mathbf{X},\mathbf{Y})\rightarrow
1/\sqrt{6}.$

To be clear, this does not give a direct proof of Theorem 1, since there are
tricky issues with the interchange of limits. Similar arguments can yield
intuition for the other constants in our results.

### Acknowledgement

We thank Sara Billey, Sam Fairchild, Alex Kontorovich, and Doug West for
valuable discussions at a variety of times about the problem of the limiting
density of $\Omega_{K}$. J.S.A. was partially supported by NSF grant DMS
2003528, ‘Curves, Counting, and Correlations’. J.S.A. also acknowledges the
hospitality of the Mathematical Sciences Research Institute (MSRI) during the
Spring 2022 program on Analysis and Geometry of Random Spaces.

## References

  * [1] Charu C. Aggarwal, Alexander Hinneburg, Daniel A. Keim, On the Surprising Behavior of Distance Metric in High-Dimensional Space, Van den Bussche, Jan (ed.) et al., Database theory - ICDT 2001. 8th international conference, London, GB, January 4–6, 2001. Proceedings. Berlin: Springer (ISBN 3-540-41456-8). Lect. Notes Comput. Sci. 1973, 420–434 (2001).
  * [2] D. H. Baileya, J. M. Borwein, R. E. Crandall, Box integrals, J. Comput. Appl. Math. 206 (2007), no. 1, 196–208.
  * [3] Uwe Bäsel, The moments of the distance between two random points in a regular polygon, preprint January 11, 2021. https://arxiv.org/pdf/2101.03815.pdf
  * [4] Sebastien Bubeck, Mark Sellke, A universal law of robustness via isoperimetry, Advances in Neural Information Processing Systems 34 pre-proceedings (NeurIPS 2021), https://arxiv.org/pdf/2105.12806.pdf.
  * [5] B. Burgstaller, F. Pillichshammer, The average distance between two points, Bull. Aust. Math. Soc., 80 (2009), no. 3 , 353–359.
  * [6] C. I. Cobeli, S. M. Gonek, A. Zaharescu, The distribution of patterns of inverses modulo a prime J. Number Theory 101 (2003), no. 2, 209–222 .
  * [7] Cristian Cobeli, Alexandru Zaharescu, On the distribution of the $\mathbb{F}_{p}$-points on an affine curve in $r$ dimensions, Acta Arith. 99 (2001), no. 4, 321–329.
  * [8] Cristian Cobeli, Alexandru Zaharescu, Generalization of a problem of Lehmer, Manuscripta Math. 104 (2001), no. 3, 301–307.
  * [9] Steven R. Dunbar, The average distance between points in geometric figures, Coll. Math. J., The College Mathematics Journal, 28 (1997), no. 3, 187–197.
  * [10] Willy Feller, Erhard Tornier, Mengentheoretische Untersuchung von Eigenschaften der Zahlenreihe, Mathematische Annalen, 107 (1932), 188–232.
  * [11] A. Gafni, A. Iosevich, E. Wyman, Uniform distribution and geometric incidence theory, preprint February 10, 2022. https://arxiv.org/pdf/2202.05359.pdf
  * [12] Richard K. Guy, Unsolved problems in number theory. Third edition. Problem Books in Mathematics. Springer-Verlag, New York, 2004. xviii+437 pp.
  * [13] A. Iosevich, On the approximate unit distance problem, Aldroubi, Akram (ed.) et al., New trends in applied harmonic analysis. Volume 2. Harmonic analysis, geometric measure theory, and applications. Collected papers based on courses given at the 2017 CIMPA school, Buenos Aires, Argentina, July 31 - August 11, 2017. Cham: Birkhäuser. Appl. Numer. Harmon. Anal., pages 121–128 (2019).
  * [14] A. Iosevich, M. Mourgoglou, K. Taylor, On the Mattila-Sjölin theorem for distance sets, Ann. Acad. Sci. Fenn., Math. 37 (2012), no. 2, 557–562.
  * [15] A. Iosevich, M. Rudnev, I. Uriarte-Tuero, Theory of dimension for large discrete sets and applications, Math. Model. Nat. Phenom. 9 (2014), no. 5, 148–169.
  * [16] A. Iosevich and S. Senger, Sharpness of Falconer’s $\frac{d+1}{2}$ estimate, Ann. Acad. Sci. Fenn. Math. 41 (2016), no. 2, 713–720.
  * [17] Hongjun Li, Xing Qiu, Moments of distance from a vertex to a uniformly distributed random point within arbitrary triangles, Math. Probl. Eng., 2016 (2016), Article ID 8371750, 10 p.
  * [18] A. M. Mathai, P. Moschopoulos, G. Pederzoli, Random points associated with rectangles, Rend. Circ. Mat. Palermo II. Ser. 48 (1999), no. 1, 163–190.
  * [19] D. Oberlin, R. Oberlin, Unit distance problems, Am. J. Math. 137 (2015), no. 1, 251–270.
  * [20] The On-line Encyclopedia of Integer Sequences, Sequence A065493, https://oeis.org/A065493.
  * [21] Sunil Srinivasa, Martin Haenggi, Distance distributions in finite uniformly random networks: theory and application, IEEE Transactions on vehicular technology, 59 (2010), no. 2, 940–949.
  * [22] André Weil, On some exponential sums, Proc. Nat. Acad. Sci. U.S.A. 34 (1948), 204–207.
  * [23] Alexandru Zaharescu, The distribution of the values of a rational function modulo a big prime, J. Théor. Nombres Bordx., 15 (2003), no. 3, 863–872.