<s>[INST] Coefficient of $x^{n-2}$ in $(x-1)(x-2)(x-3)\dotsm(x-n)$ Question

Find the coefficient of $x^{n-2}$  in the expression $$(x-1)(x-2)(x-3)\dots(x-n)~~.$$

My approach

The coefficient of $x^n$ is $1$. The coefficient of  $x^{n-1}$ is $- \frac{n(n+1)}{2}$

But I cannot proceed from here.
I would appreciate any help.
 [/INST] Observe that the coefficient of $x^1$ in $$(x-1)(x-2)(x-3)$$ is $$2\cdot3+1\cdot2+1\cdot3$$
or the coefficient of $x^{4-2}$ in $$(x-1)(x-2)(x-3)(x-4)=(x-1)(x-4)(x-2)(x-3)=(x^2-(1+4)x+1\cdot4)(x^2-(2+3)x+2\cdot3)$$
is $$2\cdot3+(1+4)(2+3)+1\cdot4$$
So, the required sum
$$=\sum_{1\le r_1<r_2\le n}r_1r_2=\dfrac{(\sum_{r=1}^n r)^2-\sum_{r=1}^n r^2}2$$
</s>