What is the maximum number of different 3-term arithmetic sequences that can be selected from a sequence of real numbers $a_{1}<a_{2}<\cdots<a_{n}$?
For every positive integer $n$, we denote by $k_{n}$ the smallest positive integer for which it holds that for any sequence $a_{1}<a_{2}<\cdots<a_{n+1}$ of positive integers, there are at least $k_{n}$ different 3-term arithmetic progressions that can be selected from these numbers. If $a_{\left\lceil\frac{n}{2}\right\rceil} < \frac{a_{1}+a_{n+1}}{2}$, then for any 3-term arithmetic progression containing $a_{n+1}$, the middle term must be greater than $\frac{a_{1}+a_{n+1}}{2}$ and less than $a_{n+1}$. Since $a_{1}2$ and $a_{1}a_{\left\lceil\frac{n}{2}\right\rceil}$, it follows that $i>\left\lceil\frac{n}{2}\right\rceil$; thus, $i$ can take at most $n-\left\lceil\frac{n}{2}\right\rceil=\left[\frac{n}{2}\right]$ different values. Therefore, the number of 3-term arithmetic progressions containing $a_{n+1}$ is at most $\left[\frac{n}{2}\right]$.

If $a_{\left\lceil\frac{n}{2}\right\rceil} \geq \frac{a_{1}+a_{n+1}}{2}$, then consider the sequence $b_{i}=-a_{n+2-i}$. Clearly, the same number of 3-term arithmetic progressions can be selected from this sequence as from the sequence $a_{1}<a_{2}<\cdots<a_{n+1}$, where $b_{1}<b_{2}<\cdots<b_{n+1}$, and here

$$
b_{\left\lceil\frac{n}{2}\right\rceil}=-a_{\left[\frac{n}{2}\right]+2}<-a_{\left\lceil\frac{n}{2}\right\rceil} \leq \frac{-a_{1}-a_{n+1}}{2}=\frac{b_{1}+b_{n+1}}{2}
$$

Therefore, the number of 3-term arithmetic progressions containing $b_{n+1}$ is at most $\left[\frac{n}{2}\right]$ according to the previous results. This shows that the number of 3-term arithmetic progressions that can be selected from $a_{1}<a_{2}<\cdots<a_{n+1}$ is at most $k_{n}+\left[\frac{n}{2}\right]$, so $k_{n+1} \leq k_{n}+\left[\frac{n}{2}\right]$. Considering the values $k_{1}=k_{2}=0$, it follows that $k_{n} \leq\left[\frac{2}{2}\right]+\left[\frac{3}{2}\right]+\cdots+\left[\frac{n-1}{2}\right]=\ell_{n}$.

Now consider the sequence $S_{n}: 1<2<\cdots<n$ for $n=3,4,5, \ldots$. We prove by induction on $n$ that the number of 3-term arithmetic progressions that can be selected from $S_{n}$ is exactly $\ell_{n}$; and thus $k_{n}=\ell_{n}$.

For $n=3$, this is clearly true. Suppose it is true for $n=m$; then the 3-term arithmetic progressions containing $(m+1)$ in $S_{m+1}$ are:

$$
2 i-m-1<i<m+1
$$

where $1 \leq 2 i-m-1$ and $i \leq m$, that is,

$$
\left\lceil\frac{m}{2}\right\rceil+1 \leq i \leq m
$$

Thus, the number of such $i$ is $m-\left\lceil\frac{m}{2}\right\rceil=\left[\frac{m}{2}\right]$, so the number of 3-term arithmetic progressions that can be selected from $S_{m+1}$ is $\ell_{m}+$ $\left[\frac{m}{2}\right]=\ell_{m+1}$, which is what we wanted to prove.

The value of $\ell_{n}=k_{n}$ (by summing the arithmetic progressions) can also be written in closed form; according to this,

$$
k_{n}=\left[\frac{2}{2}\right]+\left[\frac{3}{2}\right]+\cdots+\left[\frac{n-1}{2}\right]=\left[\frac{(n-1)^{2}}{4}\right]
$$