1. Let $S=\{1,2,3, \cdots, n\}, A$ be an arithmetic sequence with at least two terms,

with a positive common difference, all of whose terms are in $S$, and such that when the other elements of $S$ are added to $\boldsymbol{A}$, they cannot form an arithmetic sequence with the same common difference as $\boldsymbol{A}$. Find the number of such sets $A$ (sequences with only two terms are also considered arithmetic sequences).
(When $n=2 k$, in each sequence $A$ that satisfies the problem's requirements, there are two consecutive terms, such that the former term is in the set $\{1,2, \cdots, k\}$, and the latter term is in the set $\{k+1, k+2, \cdots, 2 k\}$; conversely, by selecting one number from $\{1,2, \cdots, k\}$ and one from $\{k+1, k+2, \cdots, 2 k\}$, and using the difference of these two numbers as the common difference, a sequence $A$ that meets the requirements can be constructed. It is easy to see that this correspondence is a bijection, so the number of $A$ is $k^{2}=\frac{1}{4} n^{2}$. When $n=2 k+1$, in each sequence $A$ that satisfies the problem's requirements, there must be two consecutive terms, the former term in $\{1,2, \cdots, k\}$, and the latter term in $\{k+1, k+2, \cdots, 2 k+1\}$, the discussion is similar to the previous one. Therefore, the number of $A$ is $k(k+1)=\frac{1}{4}\left(n^{2}-1\right)$. Combining both cases, there are $\left[\frac{1}{4} n^{2}\right]$ in total.)