13. Let $S=\{1,2, \cdots, n\}, A$ be an arithmetic sequence with at least two terms, a positive common difference, and all terms in $S$. Additionally, adding any other element from $S$ to $A$ does not form an arithmetic sequence with the same common difference as $A$. Find the number of such $A$ (here, sequences with only two terms are also considered arithmetic sequences).
For $n=2 k$, the sequence $A$ must have two consecutive terms, one in the set $\{1,2, \cdots, k\}$ and the other in the set $\{k+1, k+2, \cdots, n\}$. Conversely, by taking any number from $\{1,2, \cdots, k\}$ and any number from $\{k+1, k+2, \cdots, n\}$, a common difference can be formed to create an $A$. This correspondence is one-to-one, so the number of such $A$ is $k^{2}=\frac{n^{2}}{4}$.

For $n=2 k+1$, the situation is completely similar. However, the set $\{k+1, k+2, \cdots, n\}$ contains $k+1$ numbers, so the number of such $A$ is $k(k+1)=\left(n^{2}-1\right) / 4$. In summary, the number is $\left[\frac{n^{2}}{4}\right]$.