Let $X$ be a subset of $\mathbb R^2$ consisting of $n$ distinct points. Let $d\_1(X)$ be the number of pairs of points of $X$ on distance $1$ from each other. Define


$$d\_1(n)=\sup\_{X\subset \mathbb R^2|, |X|=n}d\_1(X).$$


In particular $d\_1(1)=0$, $d\_1(2)=1$, $d\_1(3)=3$, $d\_1(4)=5$, etc.


**Question.** I wonder what is known about the asymptotic behaviour of $d\_1(n)$ and about its upper bound?


It should be at least $n\log(n)$ as the following example shows:


**Example.** It is easy to see that $d\_1(2^d)\ge d2^d$, indeed, one can take the set $Y$ consisting of $d$ unit vectors and then take $2^Y$ consisting of sums of vectors over all $2^d$ subsets of $Y$. Then for generic $Y$ we have $|2^Y|=2^d$ and $d\_1(2^Y)=d2^d$. By fiddling a bit with $Y$ one can increase $d\_1(2^Y)$.



Planar subsets with many pairs of points on distance $1$
This is the so-called "Erdős unit distances problem"; see for instance the [related Wikipedia entry](https://en.wikipedia.org/wiki/Unit_distance_graph#Number_of_edges) or this [recent survey by Szemerédi](https://doi.org/10.1007/978-3-319-32162-2_15).


As you might expect, a good deal is known, but the problem is by no means resolved.


