The Wolfram Language command GeneratingFunction[expr,
n, x] gives the generating function in the variable for the sequence whose th term is expr. Given a sequence of terms, FindGeneratingFunction[a1, a2, ..., x] attempts to find a simple generating function in
coefficient is .
Given a generating function, the analytic expression for the th term in the corresponding series can be computing using
The generating function is sometimes said to "enumerate"
(Hardy 1999, p. 85).
Generating functions giving the first few powers of the nonnegative integers are given in the following table.
There are many beautiful generating functions for special functions in number theory. A few particularly nice examples are
Generating functions are very useful in combinatorial enumeration problems. For example, the subset sum problem, which asks the number
given integers such that their sum equals , can be solved using generating functions.
The generating function of of a sequence of numbers is given by the Z-transform
in the variable