1. Let $S=\{1,2, \cdots, n\}, A$ be an arithmetic sequence with at least two terms, a positive common difference, all of whose terms are in $S$, and such that adding any other element of $S$ does not form an arithmetic sequence with the same common difference as $A$. Find the number of such $A$. (Here, a sequence with only two terms can also be considered an arithmetic sequence.)
Let the common difference of $A$ be $d$, then $1 \leqslant d \leqslant n-1$. We discuss in two cases:
(1) If $n$ is even, then when $1 \leqslant d \leqslant \frac{n}{2}$, there are $d$ $A$s with a common difference of $d$; when $\frac{n}{2}+1 \leqslant d \leqslant n-1$, there are $n-d$ $A$s with a common difference of $d$. Therefore, when $n$ is even, there are $\left(1+2+\cdots+\frac{n}{2}\right)+\left[1+2+\cdots+n-\left(\frac{n}{2}+1\right)\right]=\frac{n^{2}}{4}$ such $A$s.
(2) If $n$ is odd, then when $1 \leqslant d \leqslant \frac{n-1}{2}$, there are $d$ $A$s with a common difference of $d$; when $\frac{n+1}{2} \leqslant d \leqslant n-1$, there are $n-d$ $A$s with a common difference of $d$. Therefore, when $n$ is odd, there are $\left(1+2+\cdots+\frac{n-1}{2}\right)+\left(1+2+\cdots+\frac{n-1}{2}\right)=\frac{n^{2}-1}{4}$ such $A$s.
Combining (1) and (2), we get that the number of such $A$s is $\left[\frac{n^{2}}{4}\right]$.