quick way to count Suppose we have 10 sticks with length 1-10, respectively. Pick three from them, how many triangles can we form?
I counted one by one and got 50. Is there a quick way? Any help would be appreciated.

While bruteforcing you can notice a pattern.
$$\begin{array}{c|c}
Odd&Even\\
\hline
4=3+1<3+\{2\}&5=4+1<4+\{2,3\}\\
\hline
6=5+1<5+\{2,3,4\},&7=6+1<6+\{2,3,4,5\},\\ \qquad \quad \ 4+\{3\}&
\qquad \quad \ 5+\{3,4\}\\
\hline
8=7+1<7+\{2,3,4,5,6\},&9=8+1<8+\{2,3,4,5,6,7\}, \\
\qquad \quad \ \ 6+\{3,4,5\},&\qquad \quad \ 7+\{3,4,5,6\}\\
\quad \ 5+\{4\}&\quad \ 6+\{4,5\}\\
\hline
10=9+1<9+\{2,3,4,5,6,7,8\}, \\
\qquad \quad \ \ 8+\{3,4,5,6,7\}\\
\quad \ \ 7+\{4,5,6\}\\
6+\{5\}\\
\end{array}$$
Hence, the cardinalities of the sets:
$$\sum_{i=1}^{4}\sum_{j=1}^i (2j-1)+\sum_{i=1}^3\sum_{j=1}^i (2j)=\\
\sum_{i=1}^4 (2\cdot \frac{1+i}{2}\cdot i-i)+\sum_{i=1}^3 (2\cdot \frac{1+i}{2}\cdot i)=\\
\sum_{i=1}^4 i^2+\sum_{i=1}^3 (i^2+i)=\\
\frac{4\cdot 5\cdot 9}{6}+\frac{3\cdot 4\cdot 7}{6}+\frac{1+3}{2}\cdot 3=\\
30+14+6=50.$$
The general formula for $n$:
$$\large{\sum_{i=1}^{\lfloor \frac{n}{2}-1\rfloor}\sum_{j=1}^{i} (2j-1)+\sum_{i=1}^{\lfloor \frac{n}{2}-1\rfloor}\sum_{j=1}^i (2j)}$$
