I have a pgf that seems to me would take more than 5 minutes to find f(21) of. Does anyone know how to compute f(21) of this pgf within the specified time?
f(x) = (x+x^2+x^3+x^4+x^5+x^6+x^7)^7/7^5
you could derive 21 times and divide by 21! which would take forever. The coefficient would be f(21). Any ideas?
You want: \begin{align} [x^{21}] \frac{x^7 (1 - x^7)^7}{(1 - x)^7} &= [x^{14}] (1 - x^7)^7 \sum_{n \ge 0} \binom{-7}{n} (-1)^n x^n \\ &= [x^{14}] (1 - 7 x^7 + 21 x^{14} - \ldots) \sum_{n \ge 0} \binom{n + 7 - 1}{7 - 1} x^n \\ &= \binom{20}{6} - 7 \binom{13}{6} + 21 \binom{6}{6} \\ &= 26769 \end{align} The value you are looking for is: $$ \frac{26769}{7^5} $$