Compute generating function of a sequence.
GeneratingFunction[expr, n, x]
GeneratingFunction[expr, {n1, …, nm}, {x1, …, xm}]
GeneratingFunction[a, n, x]
→ a/(1 - x)GeneratingFunction[Fibonacci[n], n, x]
→ -(x/(-1 + x + x^2))GeneratingFunction[LucasL[n], n, x]
→ (-2 + x)/(-1 + x + x^2)GeneratingFunction[CatalanNumber[n], n, x]
→ 2/(1 + Sqrt[1 - 4*x])GeneratingFunction[1/(n + 2), n, x]
→ (-1 - Log[1 - x]/x)/x- Assumptions — default $Assumptions
- GenerateConditions — default False
- Method — default Automatic
- VerifyConvergence — default True