Find the coefficient of $x^{31}$ in $(1+x+x^2+x^3+\ldots)^k$, where $k$ is a natural number
Background: I have to use generating functions to do this
I have thought about using the product rule, defining $f(x)=1+x+x^2+x^3+\ldots$ and $g(x)=(f(x))^k$ but this doesn't seem too useful since I dont know the value of $k$, and even if I knew it, if it were a large number the process would be very tedious. Could someone help me please?
Since
$$\sum_{n\ge 0}x^n=\frac1{1-x}\;,$$
you’re interested in the coefficient of $x^{31}$ in
$$\frac1{(1-x)^k}=\sum_{n\ge 0}\binom{n+k-1}nx^n\;,\tag{1}$$
which is $\binom{30+k}{31}$. $(1)$ is a standard result easily proved by induction on $k$.