How many Arithmetic Progressions having $3$ terms can be made from integers $1$ to $n$? How many Arithmetic Progressions having $3$ terms can be made from integers $1$ to $n$? The numbers in the AP must be distinct.
For example if $n=6$ then number of AP's possible are $6$ 


*

*$1,2,3$

*$2,3,4$

*$3,4,5$

*$4,5,6$

*$2,4,6$

One can select any tow distinct elements of the same parity. Together with their mean, they make such a progression.
There are $\left\lfloor \frac n2\right\rfloor$ even numbers $\le n$ and $\left\lfloor \frac{n+1}2\right\rfloor$ odd numbers.
Since we need to select unordered pairs (or ordered? But you seem not to distinguish between 1,2,3 and 3,2,1), the total number is
$$ f(n) = {\left\lfloor \frac n2\right\rfloor\choose 2}+{\left\lfloor \frac {n+1}2\right\rfloor\choose 2}.$$
If $n=2m$ is even, this amounts to 
$$ f(n) = 2{m\choose 2}=m(m-1)$$
and if $n=2m+1$ is odd, to 
$$ f(n) = {m\choose 2}+{m+1\choose 2} = m^2.$$
Both may also be summarized as
$$ f(n) = \left\lfloor\frac n2\right\rfloor\cdot\left\lfloor\frac{n-1}2\right\rfloor.$$
Example: Letting $n=6$, we obtain $f(n)=\left\lfloor\frac 62\right\rfloor\cdot\left\lfloor\frac52\right\rfloor=3\cdot 2=6$.
