Number of three-term arithmetic progressions in [n] 
Three numbers are chosen at random between 1 and $n$ (say $n=500$).What will be the probability of those numbers to be in arithmetic progression?

I don't know how to count the number of favorable events.
Sample space={(1,2,3),(4,5,6),(18,20,21)........} 
favorable events={(2,4,6),(8,12,16),(10,20,30),(50,100,150... and many more)}
I can count the sample space but how do i count the favorable events.
Some insight could help?

(Assuming three distinct numbers are chosen.)
A three-element arithmetic progress $a,b=a+k,c=a+2k$ with $k>0$ is entirely determined by $a,c$, and thus the number of them is equal to the number of ways of picking $a,c$ with the same parity (either both odd or both even.) 
The number of odd numbers from $1$ to $n$ is $\lceil n/2\rceil$ and the number and the number of even numbers from $1$ to $n$ is $\lfloor n/2\rfloor$.
This means that the number of arithmetic progressions is:
$$\binom{\lfloor n/2\rfloor}{2}+\binom{\lceil n/2\rceil}{2}$$
When $n$ is even, this is $2\binom{n/2}{2}=\frac{n(n-2)}{4}$. When $n$ is odd, this is $\binom{(n-1)/2}{2}+\binom{(n+1)/2}2=\frac{(n-1)^2}{4}.$
Both cases can be written in one formula:
$$\left\lfloor\frac{(n-1)^2}{4}\right\rfloor$$
When $n>2$ is even, the probability is:
$$\dfrac{\frac{n(n-2)}{4}}{\frac{n(n-1)(n-2)}{6}}=\frac{3}{2(n-1)}$$
When $n>1$ is odd:
$$\frac{3(n-1)}{2n(n-2)}$$
