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?