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.
Finding the coefficient of $x^{n-2}$ requires picking $2$ terms from the product to multiply the constants. Thus, we get the coefficient to be $$ \begin{align} \sum_{k=2}^n\sum_{j=1}^{k-1}jk &=\sum_{k=2}^n\sum_{j=1}^{k-1}\binom{j}{1}k\\ &=\sum_{k=2}^n\binom{k}{2}k\\ &=\sum_{k=2}^n\binom{k}{2}((k-2)+2)\\ &=\sum_{k=2}^n\left(3\binom{k}{3}+2\binom{k}{2}\right)\\ &=3\binom{n+1}{4}+2\binom{n+1}{3}\\[3pt] &=\frac{(3n+2)(n^3-n)}{24} \end{align} $$