TITLE: The number of increasing 3-term arithmetic progressions in the set $\{1,2,3,4,\dots, 2n\}$
QUESTION [8 upvotes]: In how many ways can three distinct numbers be chosen from the set $\{1,2,3,4,\dots,2n\}$ such that the numbers are in increasing arithmetic progression?

Progress: The common difference for the selected numbers can lie between 1 to $2n/3$. So it seems I need to work for every common difference from $1$ to $2n/3$. Is this fine?

REPLY [9 votes]: Solution: The second term of the AP is determined entirely by the other two terms.But the first term $a$ and third term $a+2d$ have the same parity(adding the even number $2d$ does not change their parity).
If they are both odd,then they can be selected in $\dbinom{n}{2}$ ways.
If they are both even,they can be selected in $\dbinom{n}{2}$ ways.
Adding them up,we get $n(n-1)$.
Credits: Thanks to Mark Bennet for helping me with this solution.