Find the coefficient of $x^{70}$ in the expansion
$$(x-1)(x^2-2)(x^3-3)(x^4-4)\cdots (x^{12}-12)$$
$\mathcal {\text {Now I have solved this question}}$. What I did was I noticed that the highest power that can be formed in this expansion would be $78$ . Hence I need to find the sum of Distinct numbers that on addition would form $8$ and I have to multiply them among themselves . Hence the answer would be simply
$$(-8) + [(-1)(-7) + (-2)(-6) + (-3)(-5)] + [(-1)(-3)(-4) + (-1)(-2)(-5)] = 4$$
$\mathcal {\text {But what if something like coefficient of $x^{20}$ would have been asked}}$.
Because the way I used would expend a lot of time to solve it. I want to know if there are any standard methods to solve it.
Dividing by $x^{78}$ and substituting $x\mapsto\frac1x$ shows that $$ \left[x^{70}\right]\prod_{k=1}^{12}\left(x^k-k\right)=\left[x^8\right]\prod_{k=1}^{12}\left(1-kx^k\right) $$ and $$ \left[x^{20}\right]\prod_{k=1}^{12}\left(x^k-k\right)=\left[x^{58}\right]\prod_{k=1}^{12}\left(1-kx^k\right) $$ It is not too difficult to derive the recursion $$ \overbrace{\left[x^m\right]\prod_{k=1}^{n\vphantom{-1}}\left(1-kx^k\right)}^{a(n,m)} =\overbrace{\left[x^m\right]\prod_{k=1}^{n-1}\left(1-kx^k\right)}^{a(n-1,m)} -n\,\overbrace{\left[x^{m-n}\right]\prod_{k=1}^{n-1}\left(1-kx^k\right)}^{a(n-1,m-n)} $$ So if we define $$ a(n,m)=\left\{\begin{array}{} 0&\text{if $m\lt0$ or $m\gt\frac{n(n+1)}2$}\\ 1&\text{if $m=0$}\\ a(n-1,m)-n\,a(n-1,m-n)&\text{otherwise} \end{array}\right. $$ then $$ a(12,8)=4 $$ and $$ a(12,58)=1152600 $$ This requires less work than computing $\prod\limits_{k=1}^{12}\left(x^k-k\right)$, but it still is not simple.
Although, when doing this by hand, the table of $a(n,m)$ gets big, it is no more difficult than computing Pascal's Triangle. For example, computing $a(12,58)$ required only $75$ values to be computed; that is less than computing $12$ rows of Pascal's Triangle.
Mathematica Code
a[n_,m_]:=If[m==0,1,If[m<0||m>n(n+1)/2,0,a[n,m]=a[n-1,m]-n a[n-1,m-n]]]