Problem. For a sequence $a_{1}<a_{2}<\cdots<a_{n}$ of integers, a pair $\left(a_{i}, a_{j}\right)$ with $1 \leq i<j \leq n$ is called interesting if there exists a pair $\left(a_{k}, a_{l}\right)$ of integers with $1 \leq k<l \leq n$ such that

$$
\frac{a_{l}-a_{k}}{a_{j}-a_{i}}=2
$$

For each $n \geq 3$, find the largest possible number of interesting pairs in a sequence of length $n$.

Answer. $\frac{1}{2}(n-1)(n-2)+1$.
Consider the numbers $a_{i}=2^{i}$ for $2 \leq i \leq n$ and $a_{1}=0$, and choose any pair $(i, j)$ with $1 \leq i < j \leq n$. If $(i, j)$ is interesting, then $a_{j}-a_{i} \leq a_{n}-a_{1}$ (otherwise, if $a_{j}-a_{i} > a_{n}-a_{1}$ we would have $a_{l}-a_{k} > a_{n}-a_{1}$, which is not possible.)

Finally, for any $2 \leq i \leq n-1$ consider pairs $(1, i)$ and $(i, n)$. If both of them are interesting, then, following the observation above, the only possibility is $a_{i}-a_{1}=a_{n}-a_{i}=\frac{a_{n}-a_{1}}{2}$. Clearly, this is possible for at most one $i$, so for all other $n-3$ values of $i$, at least one of pairs $(1, i)$ and $(i, n)$ is not interesting. Combining with the pair $(1, n)$, we get at least $n-2$ not interesting pairs in total, as desired.

Comment: The originally proposed formulation considered a sequence $a_{1}<a_{2}<\cdots<a_{n}$ of $n$ real numbers, rather than integers. The conclusion is however the same and the solution is identical.