How many sequences are there, with the length of $n$ above $\left\{0,1,2,3,4\right\}$ such that the digits sum is $9$.
The solution offers the following generating function for the problem:
$$ (1+x+x^2+x^3+x^4)^n $$
Yet, for my understanding the order is important here (sequences). Hence the generating function should be: $$\left(1+x + \frac{x^2}{2!} + \frac{x^3}{3!} + \frac{x^4}{4!}\right)^n$$
Who's right?
Note that the $i$-th $(1+x+x^2+x^3+x^4)$ term stands for the value of the $i$-th digit, therefore the terms already takes the order into consideration.
We have $n$ digits - and therefore $n$ of those terms.
To get the number of valid sequences, you need to find $x^9$ coefficient