3. $S=\{1,2, \cdots, 2009\}, A$ is a three-element subset of $S$, satisfying: all elements in $A$ can form an arithmetic sequence. Then, the number of such three-element subsets $A$ is $\qquad$ .
3. 1008016 Explanation: $a, b, c$ form an arithmetic sequence $\Leftrightarrow a, c$ have the same parity, hence there are $C_{1005}^{2}+C_{1004}^{2}=1008016$.