Let $A$ be a set of size 2023. Find the maximum number of pairs of elements $x, y \in A$ so that $x-y$ is a power of $e$.

#
Let $a_{n}$ be the maximum possible number of such pairs for a set of size $n$. Let $s_{2}(n)$ be the number of ones in $n$ 's binary representation. Let $S(n)=\sum_{k=0}^{n-1} s_{2}(k)$. We show that $a_{n}=S(n)$.

For the construction, we can take the binary representations of all numbers from 0 to $n-1$, and interpret them as numbers "base $e$ ". Every $x$ corresponding to some integer $0 \leq k1$. If $A$ has no working pairs $x, y$, we are done. Otherwise, let $t$ be an integer so that there is at least one pair $x, y \in A$ so that $x-y=e^{t}$.

Let $G$ be the graph of such pairs in $A$. If $G$ is not connected, we can increase the number of edges of $G$ by shifting the vertices of one component of $G$ to create at least one edge to another component. Thus we can assume that all elements of $A$ are sums of powers of $e$. Let For an element $z \in A$, let $c_{z}$ be the coefficient of $e^{t}$ in the representation of $A$ as a sum.

Let $X$ be the set of $z$ so that $c_{z} \geq c_{x}$ and let $Y$ be the set of $z$ so that $c_{z} \leq c_{y}$. Note that $X \sqcup Y=A$. By strong induction, there are at most $a_{|X|}$ working pairs in $X$, and at most $a_{|Y|}$ pairs in $Y$. By definition of $X$ and $Y$, any pair between them can only have one possible difference, namely $e^{t}$. Thus, there are at $\operatorname{most} \min (|X|,|Y|)$ pairs between them.

Thus, we have the recurrence $a_{n} \leq \max _{X+Y=n}\left(a_{X}+a_{Y}\right)+\min (X, Y)$. It thus suffices to show that if $Y \geq X, S(X+Y)-S(Y) \geq S(X)+X$, which expands to
$\sum_{k=Y}^{Y+X-1} s_{2}(k) \geq \sum_{k=0}^{X-1}\left(1+s_{2}(k)\right)$. An exercise to the interested reader is to show this by strong induction on $X$.

Now it remains to evaluate $S(2023)$. By linearity of expectation, $S(2048)$ is equal to $2048 \cdot 11 / 2$. For every number from $2032=2048-16$ to 2048,7 digits must be 1 and the remaining four each have a half chance of being 1, giving $S(2048)-S(2032)=$ $16 \cdot(7+4 / 2)$. Similarly $S(2032)-S(2024)=8 \cdot(7+3 / 2), S(2024)-S(2023)$ is just the number of ones in $2023=11111100111_{2}$ is 9 . Thus the answer is

$2048 \cdot 11 / 2-16 \cdot(7+4 / 2)-8 \cdot(7+3 / 2)-9=11043$.