This article may be too long to read and navigate comfortably. Please consider splitting content into sub-articles, condensing it, or adding subheadings. Please discuss this issue on the article's talk page. (July 2022)

In mathematics, a **generating function** is a way of encoding an infinite sequence of numbers (*a*_{n}) by treating them as the coefficients of a formal power series. This series is called the generating function of the sequence. Unlike an ordinary series, the *formal* power series is not required to converge: in fact, the generating function is not actually regarded as a function, and the "variable" remains an indeterminate. Generating functions were first introduced by Abraham de Moivre in 1730, in order to solve the general linear recurrence problem.^{[1]} One can generalize to formal power series in more than one indeterminate, to encode information about infinite multi-dimensional arrays of numbers.

There are various types of generating functions, including **ordinary generating functions**, **exponential generating functions**, **Lambert series**, **Bell series**, and **Dirichlet series**; definitions and examples are given below. Every sequence in principle has a generating function of each type (except that Lambert and Dirichlet series require indices to start at 1 rather than 0), but the ease with which they can be handled may differ considerably. The particular generating function, if any, that is most useful in a given context will depend upon the nature of the sequence and the details of the problem being addressed.

Generating functions are often expressed in closed form (rather than as a series), by some expression involving operations defined for formal series. These expressions in terms of the indeterminate x may involve arithmetic operations, differentiation with respect to x and composition with (i.e., substitution into) other generating functions; since these operations are also defined for functions, the result looks like a function of x. Indeed, the closed form expression can often be interpreted as a function that can be evaluated at (sufficiently small) concrete values of x, and which has the formal series as its series expansion; this explains the designation "generating functions". However such interpretation is not required to be possible, because formal series are not required to give a convergent series when a nonzero numeric value is substituted for x. Also, not all expressions that are meaningful as functions of x are meaningful as expressions designating formal series; for example, negative and fractional powers of x are examples of functions that do not have a corresponding formal power series.

Generating functions are not functions in the formal sense of a mapping from a domain to a codomain. Generating functions are sometimes called **generating series**,^{[2]} in that a series of terms can be said to be the generator of its sequence of term coefficients.

A generating function is a device somewhat similar to a bag. Instead of carrying many little objects detachedly, which could be embarrassing, we put them all in a bag, and then we have only one object to carry, the bag.

A generating function is a clothesline on which we hang up a sequence of numbers for display.— Herbert Wilf,Generatingfunctionology(1994)

The *ordinary generating function* of a sequence *a*_{n} is

When the term *generating function* is used without qualification, it is usually taken to mean an ordinary generating function.

If *a*_{n} is the probability mass function of a discrete random variable, then its ordinary generating function is called a probability-generating function.

The ordinary generating function can be generalized to arrays with multiple indices. For example, the ordinary generating function of a two-dimensional array *a*_{m,n} (where n and m are natural numbers) is

The *exponential generating function* of a sequence *a*_{n} is

Exponential generating functions are generally more convenient than ordinary generating functions for combinatorial enumeration problems that involve labelled objects.^{[3]}

Another benefit of exponential generating functions is that they are useful in transferring linear recurrence relations to the realm of differential equations. For example, take the Fibonacci sequence {*f _{n}*} that satisfies the linear recurrence relation

and its derivatives can readily be shown to satisfy the differential equation EF″(*x*) = EF′(*x*) + EF(*x*) as a direct analogue with the recurrence relation above. In this view, the factorial term *n*! is merely a counter-term to normalise the derivative operator acting on *x*^{n}.

The *Poisson generating function* of a sequence *a*_{n} is

Main article: Lambert series |

The *Lambert series* of a sequence *a*_{n} is

The Lambert series coefficients in the power series expansions

for integers *n* ≥ 1 are related by the divisor sum

The main article provides several more classical, or at least well-known examples related to special arithmetic functions in number theory.

In a Lambert series the index n starts at 1, not at 0, as the first term would otherwise be undefined.

The Bell series of a sequence *a*_{n} is an expression in terms of both an indeterminate x and a prime p and is given by^{[4]}

Formal Dirichlet series are often classified as generating functions, although they are not strictly formal power series. The *Dirichlet series generating function* of a sequence *a*_{n} is^{[5]}

The Dirichlet series generating function is especially useful when *a*_{n} is a multiplicative function, in which case it has an Euler product expression^{[6]} in terms of the function's Bell series

If *a*_{n} is a Dirichlet character then its Dirichlet series generating function is called a Dirichlet L-series. We also have a relation between the pair of coefficients in the Lambert series expansions above and their DGFs. Namely, we can prove that

if and only if

where *ζ*(*s*) is the Riemann zeta function.^{[7]}

The idea of generating functions can be extended to sequences of other objects. Thus, for example, polynomial sequences of binomial type are generated by

where *p*_{n}(*x*) is a sequence of polynomials and *f*(*t*) is a function of a certain form. Sheffer sequences are generated in a similar way. See the main article generalized Appell polynomials for more information.

Polynomials are a special case of ordinary generating functions, corresponding to finite sequences, or equivalently sequences that vanish after a certain point. These are important in that many finite sequences can usefully be interpreted as generating functions, such as the Poincaré polynomial and others.

A fundamental generating function is that of the constant sequence 1, 1, 1, 1, 1, 1, 1, 1, 1, ..., whose ordinary generating function is the geometric series

The left-hand side is the Maclaurin series expansion of the right-hand side. Alternatively, the equality can be justified by multiplying the power series on the left by 1 − *x*, and checking that the result is the constant power series 1 (in other words, that all coefficients except the one of *x*^{0} are equal to 0). Moreover, there can be no other power series with this property. The left-hand side therefore designates the multiplicative inverse of 1 − *x* in the ring of power series.

Expressions for the ordinary generating function of other sequences are easily derived from this one. For instance, the substitution *x* → *ax* gives the generating function for the geometric sequence 1, *a*, *a*^{2}, *a*^{3}, ... for any constant a:

(The equality also follows directly from the fact that the left-hand side is the Maclaurin series expansion of the right-hand side.) In particular,

One can also introduce regular gaps in the sequence by replacing x by some power of x, so for instance for the sequence 1, 0, 1, 0, 1, 0, 1, 0, ... (which skips over *x*, *x*^{3}, *x*^{5}, ...) one gets the generating function

By squaring the initial generating function, or by finding the derivative of both sides with respect to x and making a change of running variable *n* → *n* + 1, one sees that the coefficients form the sequence 1, 2, 3, 4, 5, ..., so one has

and the third power has as coefficients the triangular numbers 1, 3, 6, 10, 15, 21, ... whose term n is the binomial coefficient (^{n + 2}_{2}), so that

More generally, for any non-negative integer k and non-zero real value a, it is true that

Since

one can find the ordinary generating function for the sequence 0, 1, 4, 9, 16, ... of square numbers by linear combination of binomial-coefficient generating sequences:

We may also expand alternately to generate this same sequence of squares as a sum of derivatives of the geometric series in the following form:

By induction, we can similarly show for positive integers *m* ≥ 1 that^{[8]}^{[9]}

where {^{n}_{k}} denote the Stirling numbers of the second kind and where the generating function

so that we can form the analogous generating functions over the integral mth powers generalizing the result in the square case above. In particular, since we can write

we can apply a well-known finite sum identity involving the Stirling numbers to obtain that^{[10]}

Main article: Linear recursive sequence |

The ordinary generating function of a sequence can be expressed as a rational function (the ratio of two finite-degree polynomials) if and only if the sequence is a linear recursive sequence with constant coefficients; this generalizes the examples above. Conversely, every sequence generated by a fraction of polynomials satisfies a linear recurrence with constant coefficients; these coefficients are identical to the coefficients of the fraction denominator polynomial (so they can be directly read off). This observation shows it is easy to solve for generating functions of sequences defined by a linear finite difference equation with constant coefficients, and then hence, for explicit closed-form formulas for the coefficients of these generating functions. The prototypical example here is to derive Binet's formula for the Fibonacci numbers via generating function techniques.

We also notice that the class of rational generating functions precisely corresponds to the generating functions that enumerate *quasi-polynomial* sequences of the form ^{[11]}

where the reciprocal roots, , are fixed scalars and where *p*_{i}(*n*) is a polynomial in n for all 1 ≤ *i* ≤ *ℓ*.

In general, Hadamard products of rational functions produce rational generating functions. Similarly, if

is a bivariate rational generating function, then its corresponding *diagonal generating function*,

is *algebraic*. For example, if we let^{[12]}

then this generating function's diagonal coefficient generating function is given by the well-known OGF formula

This result is computed in many ways, including Cauchy's integral formula or contour integration, taking complex residues, or by direct manipulations of formal power series in two variables.

Main article: Cauchy product |

Multiplication of ordinary generating functions yields a discrete convolution (the Cauchy product) of the sequences. For example, the sequence of cumulative sums (compare to the slightly more general Euler–Maclaurin formula)

of a sequence with ordinary generating function

because 1/1 −

For integers *m* ≥ 1, we have the following two analogous identities for the modified generating functions enumerating the shifted sequence variants of ⟨ *g*_{n − m} ⟩ and ⟨ *g*_{n + m} ⟩, respectively:

We have the following respective power series expansions for the first derivative of a generating function and its integral:

The differentiation–multiplication operation of the second identity can be repeated k times to multiply the sequence by *n*^{k}, but that requires alternating between differentiation and multiplication. If instead doing k differentiations in sequence, the effect is to multiply by the kth falling factorial:

Using the Stirling numbers of the second kind, that can be turned into another formula for multiplying by as follows (see the main article on generating function transformations):

A negative-order reversal of this sequence powers formula corresponding to the operation of repeated integration is defined by the zeta series transformation and its generalizations defined as a derivative-based transformation of generating functions, or alternately termwise by and performing an integral transformation on the sequence generating function. Related operations of performing fractional integration on a sequence generating function are discussed here.

In this section we give formulas for generating functions enumerating the sequence {*f*_{an + b}} given an ordinary generating function *F*(*z*), where *a* ≥ 2, 0 ≤ *b* < *a*, and *a* and *b* are integers (see the main article on transformations). For *a* = 2, this is simply the familiar decomposition of a function into even and odd parts (i.e., even and odd powers):

More generally, suppose that *a* ≥ 3 and that *ω _{a}* = exp 2

For integers *m* ≥ 1, another useful formula providing somewhat *reversed* floored arithmetic progressions — effectively repeating each coefficient m times — are generated by the identity^{[14]}

A formal power series (or function) *F*(*z*) is said to be **holonomic** if it satisfies a linear differential equation of the form^{[15]}

where the coefficients *c _{i}*(

Since we can clear denominators if need be in the previous equation, we may assume that the functions, *c _{i}*(

for all large enough *n* ≥ *n*_{0} and where the *ĉ _{i}*(

The functions *e*^{z}, log *z*, cos *z*, arcsin *z*, , the dilogarithm function Li_{2}(*z*), the generalized hypergeometric functions * _{p}F_{q}*(...; ...;

and the non-convergent

are all holonomic.

Examples of P-recursive sequences with holonomic generating functions include *f*_{n} ≔ 1/*n* + 1 (^{2n}_{n}) and *f*_{n} ≔ 2^{n}/*n*^{2} + 1, where sequences such as and log *n* are *not* P-recursive due to the nature of singularities in their corresponding generating functions. Similarly, functions with infinitely many singularities such as tan *z*, sec *z*, and Γ(*z*) are *not* holonomic functions.

Tools for processing and working with P-recursive sequences in *Mathematica* include the software packages provided for non-commercial use on the RISC Combinatorics Group algorithmic combinatorics software site. Despite being mostly closed-source, particularly powerful tools in this software suite are provided by the

package for guessing **Guess***P-recurrences* for arbitrary input sequences (useful for experimental mathematics and exploration) and the

package which is able to find P-recurrences for many sums and solve for closed-form solutions to P-recurrences involving generalized harmonic numbers.**Sigma**^{[16]} Other packages listed on this particular RISC site are targeted at working with holonomic *generating functions* specifically.

Main article: Discrete-time Fourier transform |

When the series converges absolutely,

is the discrete-time Fourier transform of the sequence

In calculus, often the growth rate of the coefficients of a power series can be used to deduce a radius of convergence for the power series. The reverse can also hold; often the radius of convergence for a generating function can be used to deduce the asymptotic growth of the underlying sequence.

For instance, if an ordinary generating function *G*(*a*_{n}; *x*) that has a finite radius of convergence of r can be written as

where each of *A*(*x*) and *B*(*x*) is a function that is analytic to a radius of convergence greater than r (or is entire), and where *B*(*r*) ≠ 0 then

using the gamma function, a binomial coefficient, or a multiset coefficient.

Often this approach can be iterated to generate several terms in an asymptotic series for *a*_{n}. In particular,

The asymptotic growth of the coefficients of this generating function can then be sought via the finding of A, B, α, β, and r to describe the generating function, as above.

Similar asymptotic analysis is possible for exponential generating functions; with an exponential generating function, it is *a*_{n}/*n*! that grows according to these asymptotic formulae. Generally, if the generating function of one sequence minus the generating function of a second sequence has a radius of convergence that is larger than the radius of convergence of the individual generating functions then the two sequences have the same asymptotic growth.

As derived above, the ordinary generating function for the sequence of squares is

With *r* = 1, *α* = −1, *β* = 3, *A*(*x*) = 0, and *B*(*x*) = *x* + 1, we can verify that the squares grow as expected, like the squares:

Main article: Catalan number |

The ordinary generating function for the Catalan numbers is

With *r* = 1/4, *α* = 1, *β* = −1/2, *A*(*x*) = 1/2, and *B*(*x*) = −1/2, we can conclude that, for the Catalan numbers,

One can define generating functions in several variables for arrays with several indices. These are called **multivariate generating functions** or, sometimes, **super generating functions**. For two variables, these are often called **bivariate generating functions**.

For instance, since (1 + *x*)^{n} is the ordinary generating function for binomial coefficients for a fixed n, one may ask for a bivariate generating function that generates the binomial coefficients (^{n}_{k}) for all k and n. To do this, consider (1 + *x*)^{n} itself as a sequence in n, and find the generating function in y that has these sequence values as coefficients. Since the generating function for *a*^{n} is

the generating function for the binomial coefficients is:

Expansions of (formal) *Jacobi-type* and *Stieltjes-type* continued fractions (*J-fractions* and *S-fractions*, respectively) whose hth rational convergents represent 2*h*-order accurate power series are another way to express the typically divergent ordinary generating functions for many special one and two-variate sequences. The particular form of the Jacobi-type continued fractions (J-fractions) are expanded as in the following equation and have the next corresponding power series expansions with respect to z for some specific, application-dependent component sequences, {ab_{i}} and {*c*_{i}}, where *z* ≠ 0 denotes the formal variable in the second power series expansion given below:^{[17]}

The coefficients of , denoted in shorthand by *j _{n}* ≔ [

where *j*_{0} ≡ *k*_{0,0} = 1, *j _{n}* =

For *h* ≥ 0 (though in practice when *h* ≥ 2), we can define the rational hth convergents to the infinite J-fraction, *J*^{[∞]}(*z*), expanded by

component-wise through the sequences, *P _{h}*(

Moreover, the rationality of the convergent function Conv_{h}(*z*) for all *h* ≥ 2 implies additional finite difference equations and congruence properties satisfied by the sequence of *j _{n}*,

for non-symbolic, determinate choices of the parameter sequences {ab_{i}} and {*c*_{i}} when *h* ≥ 2, that is, when these sequences do not implicitly depend on an auxiliary parameter such as q, x, or R as in the examples contained in the table below.

The next table provides examples of closed-form formulas for the component sequences found computationally (and subsequently proved correct in the cited references^{[18]})
in several special cases of the prescribed sequences, *j _{n}*, generated by the general expansions of the J-fractions defined in the first subsection. Here we define 0 < |

The radii of convergence of these series corresponding to the definition of the Jacobi-type J-fractions given above are in general different from that of the corresponding power series expansions defining the ordinary generating functions of these sequences.

Generating functions for the sequence of square numbers *a*_{n} = *n*^{2} are:

As an example of a Lambert series identity not given in the main article, we can show that for |*x*|, |*xq*| < 1 we have that ^{[19]}

where we have the special case identity for the generating function of the divisor function, *d*(*n*) ≡ *σ*_{0}(*n*), given by

using the Riemann zeta function.

The sequence a_{k} generated by a Dirichlet series generating function (DGF) corresponding to:

where *ζ*(*s*) is the Riemann zeta function, has the ordinary generating function:

Multivariate generating functions arise in practice when calculating the number of contingency tables of non-negative integers with specified row and column totals. Suppose the table has r rows and c columns; the row sums are *t*_{1}, *t*_{2} ... *t _{r}* and the column sums are

in

In the bivariate case, non-polynomial double sum examples of so-termed "*double*" or "*super*" generating functions of the form

include the following two-variable generating functions for the binomial coefficients, the Stirling numbers, and the Eulerian numbers:^{[21]}

Generating functions give us several methods to manipulate sums and to establish identities between sums.

The simplest case occurs when *s _{n}* = Σ

For example, we can manipulate

where

be the ordinary generating function of the harmonic numbers. Then

and thus

Using

convolution with the numerator yields

which can also be written as

As another example of using generating functions to relate sequences and manipulate sums, for an arbitrary sequence ⟨ *f _{n}* ⟩ we define the two sequences of sums

for all

First, we use the binomial transform to write the generating function for the first sum as

Since the generating function for the sequence ⟨ (*n* + 1)(*n* + 2)(*n* + 3) *f _{n}* ⟩ is given by

we may write the generating function for the second sum defined above in the form

In particular, we may write this modified sum generating function in the form of

for

Finally, it follows that we may express the second sums through the first sums in the following form:

In this example, we reformulate a generating function example given in Section 7.3 of *Concrete Mathematics* (see also Section 7.1 of the same reference for pretty pictures of generating function series). In particular, suppose that we seek the total number of ways (denoted *U _{n}*) to tile a 3-by-n rectangle with unmarked 2-by-1 domino pieces. Let the auxiliary sequence,

If we consider the possible configurations that can be given starting from the left edge of the 3-by-n rectangle, we are able to express the following mutually dependent, or *mutually recursive*, recurrence relations for our two sequences when *n* ≥ 2 defined as above where *U*_{0} = 1, *U*_{1} = 0, *V*_{0} = 0, and *V*_{1} = 1:

Since we have that for all integers *m* ≥ 0, the index-shifted generating functions satisfy^{[note 1]}

we can use the initial conditions specified above and the previous two recurrence relations to see that we have the next two equations relating the generating functions for these sequences given by

which then implies by solving the system of equations (and this is the particular trick to our method here) that

Thus by performing algebraic simplifications to the sequence resulting from the second partial fractions expansions of the generating function in the previous equation, we find that *U*_{2n + 1} ≡ 0 and that

for all integers

A discrete *convolution* of the terms in two formal power series turns a product of generating functions into a generating function enumerating a convolved sum of the original sequence terms (see Cauchy product).

- Consider
*A*(*z*) and*B*(*z*) are ordinary generating functions. - Consider
*A*(*z*) and*B*(*z*) are exponential generating functions. - Consider the triply convolved sequence resulting from the product of three ordinary generating functions
- Consider the m-fold convolution of a sequence with itself for some positive integer
*m*≥ 1 (see the example below for an application)

Multiplication of generating functions, or convolution of their underlying sequences, can correspond to a notion of independent events in certain counting and probability scenarios. For example, if we adopt the notational convention that the probability generating function, or *pgf*, of a random variable Z is denoted by *G _{Z}*(

if X and Y are independent. Similarly, the number of ways to pay

and moreover, if we allow the n cents to be paid in coins of any positive integer denomination, we arrive at the generating for the number of such combinations of change being generated by the partition function generating function expanded by the infinite q-Pochhammer symbol product of

An example where convolutions of generating functions are useful allows us to solve for a specific closed-form function representing the ordinary generating function for the Catalan numbers, *C _{n}*. In particular, this sequence has the combinatorial interpretation as being the number of ways to insert parentheses into the product

and so has a corresponding convolved generating function,

Since *C*(0) = 1 ≠ ∞, we then arrive at a formula for this generating function given by

Note that the first equation implicitly defining *C*(*z*) above implies that

which then leads to another "simple" (of form) continued fraction expansion of this generating function.

A *fan of order n* is defined to be a graph on the vertices {0, 1, ..., *n*} with 2*n* − 1 edges connected according to the following rules: Vertex 0 is connected by a single edge to each of the other n vertices, and vertex is connected by a single edge to the next vertex *k* + 1 for all 1 ≤ *k* < *n*.^{[23]} There is one fan of order one, three fans of order two, eight fans of order three, and so on. A spanning tree is a subgraph of a graph which contains all of the original vertices and which contains enough edges to make this subgraph connected, but not so many edges that there is a cycle in the subgraph. We ask how many spanning trees *f _{n}* of a fan of order n are possible for each

As an observation, we may approach the question by counting the number of ways to join adjacent sets of vertices. For example, when *n* = 4, we have that *f*_{4} = 4 + 3 · 1 + 2 · 2 + 1 · 3 + 2 · 1 · 1 + 1 · 2 · 1 + 1 · 1 · 2 + 1 · 1 · 1 · 1 = 21, which is a sum over the m-fold convolutions of the sequence *g _{n}* =

from which we see that the ordinary generating function for this sequence is given by the next sum of convolutions as

from which we are able to extract an exact formula for the sequence by taking the partial fraction expansion of the last generating function.

This section needs expansion with: This section needs to be added to the list of techniques with generating functions. You can help by adding to it. (April 2017)

Sometimes the sum *s _{n}* is complicated, and it is not always easy to evaluate. The "Free Parameter" method is another method (called "snake oil" by H. Wilf) to evaluate these sums.

Both methods discussed so far have n as limit in the summation. When n does not appear explicitly in the summation, we may consider n as a "free" parameter and treat *s _{n}* as a coefficient of

For example, if we want to compute

we can treat n as a "free" parameter, and set

Interchanging summation ("snake oil") gives

Now the inner sum is *z*^{m + 2k}/(1 − *z*)^{m + 2k + 1}. Thus

Then we obtain

It is instructive to use the same method again for the sum, but this time take m as the free parameter instead of n. We thus set

Interchanging summation ("snake oil") gives

Now the inner sum is (1 + *z*)^{n + k}. Thus

Thus we obtain

for

We say that two generating functions (power series) are congruent modulo m, written *A*(*z*) ≡ *B*(*z*) (mod *m*) if their coefficients are congruent modulo m for all *n* ≥ 0, i.e., *a _{n}* ≡

satisfy the following congruence modulo 3:

One of the most useful, if not downright powerful, methods of obtaining congruences for sequences enumerated by special generating functions modulo any integers (i.e., not only prime powers *p ^{k}*) is given in the section on continued fraction representations of (even non-convergent) ordinary generating functions by J-fractions above. We cite one particular result related to generating series expanded through a representation by continued fraction from Lando's

**Theorem: congruences for series generated by expansions of continued fractions** — Suppose that the generating function *A*(*z*) is represented by an infinite continued fraction of the form

and that

- the function
*A*(_{p}*z*) is rational for all*p*≥ 2 where we assume that one of divisibility criteria of*p*|*p*_{1},*p*_{1}*p*_{2},*p*_{1}*p*_{2}*p*_{3}is met, that is,*p*|*p*_{1}*p*_{2}⋯*p*_{k}for some*k*≥ 1; and - if the integer p divides the product
*p*_{1}*p*_{2}⋯*p*_{k}, then we have*A*(*z*) ≡*A*(_{k}*z*) (mod*p*).

Generating functions also have other uses in proving congruences for their coefficients. We cite the next two specific examples deriving special case congruences for the Stirling numbers of the first kind and for the partition function *p*(*n*) which show the versatility of generating functions in tackling problems involving integer sequences.

The main article on the Stirling numbers generated by the finite products

provides an overview of the congruences for these numbers derived strictly from properties of their generating function as in Section 4.6 of Wilf's stock reference *Generatingfunctionology*.
We repeat the basic argument and notice that when reduces modulo 2, these finite product generating functions each satisfy

which implies that the parity of these Stirling numbers matches that of the binomial coefficient

and consequently shows that [^{n}_{k}] is even whenever *k* < ⌊ *n*/2 ⌋.

Similarly, we can reduce the right-hand-side products defining the Stirling number generating functions modulo 3 to obtain slightly more complicated expressions providing that

In this example, we pull in some of the machinery of infinite products whose power series expansions generate the expansions of many special functions and enumerate partition functions. In particular, we recall that *the* partition function *p*(*n*) is generated by the reciprocal infinite q-Pochhammer symbol product (or z-Pochhammer product as the case may be) given by

This partition function satisfies many known congruence properties, which notably include the following results though there are still many open questions about the forms of related integer congruences for the function:^{[25]}

We show how to use generating functions and manipulations of congruences for formal power series to give a highly elementary proof of the first of these congruences listed above.

First, we observe that in the binomial coefficient generating function

all of the coefficients are divisible by 5 except for those which correspond to the powers 1,

or equivalently

It follows that

Using the infinite product expansions of

it can be shown that the coefficient of

we may equate the coefficients of

There are a number of transformations of generating functions that provide other applications (see the main article). A transformation of a sequence's *ordinary generating function* (OGF) provides a method of converting the generating function for one sequence into a generating function enumerating another. These transformations typically involve integral formulas involving a sequence OGF (see integral transformations) or weighted sums over the higher-order derivatives of these functions (see derivative transformations).

Generating function transformations can come into play when we seek to express a generating function for the sums

in the form of *S*(*z*) = *g*(*z*) *A*(*f*(*z*)) involving the original sequence generating function. For example, if the sums are

then the generating function for the modified sum expressions is given by

(see also the binomial transform and the Stirling transform).

There are also integral formulas for converting between a sequence's OGF, *F*(*z*), and its exponential generating function, or EGF, *F̂*(*z*), and vice versa given by

provided that these integrals converge for appropriate values of z.

Generating functions are used to:

- Find a closed formula for a sequence given in a recurrence relation. For example, consider Fibonacci numbers.
- Find recurrence relations for sequences—the form of a generating function may suggest a recurrence formula.
- Find relationships between sequences—if the generating functions of two sequences have a similar form, then the sequences themselves may be related.
- Explore the asymptotic behaviour of sequences.
- Prove identities involving sequences.
- Solve enumeration problems in combinatorics and encoding their solutions. Rook polynomials are an example of an application in combinatorics.
- Evaluate infinite sums.

Examples of polynomial sequences generated by more complex generating functions include:

- Appell polynomials
- Chebyshev polynomials
- Difference polynomials
- Generalized Appell polynomials
- q-difference polynomials

Other sequences generated by more complex generating functions:

- Double exponential generating functions. For example: Aitken's Array: Triangle of Numbers
- Hadamard products of generating functions and diagonal generating functions, and their corresponding integral transformations

Knuth's article titled "*Convolution Polynomials*"^{[28]} defines a generalized class of *convolution polynomial* sequences by their special generating functions of the form

for some analytic function F with a power series expansion such that

We say that a family of polynomials, *f*_{0}, *f*_{1}, *f*_{2}, ..., forms a *convolution family* if deg *f _{n}* ≤

We see that for non-identically zero convolution families, this definition is equivalent to requiring that the sequence have an ordinary generating function of the first form given above.

A sequence of convolution polynomials defined in the notation above has the following properties:

- The sequence
*n*! ·*f*(_{n}*x*) is of binomial type - Special values of the sequence include
*f*(1) = [_{n}*z*]^{n}*F*(*z*) and*f*(0) =_{n}*δ*_{n,0}, and - For arbitrary (fixed) , these polynomials satisfy convolution formulas of the form

For a fixed non-zero parameter , we have modified generating functions for these convolution polynomial sequences given by

where 𝓕

Examples of convolution polynomial sequences include the *binomial power series*, 𝓑_{t}(*z*) = 1 + *z*𝓑_{t}(*z*)^{t}, so-termed *tree polynomials*, the Bell numbers, *B*(*n*), the Laguerre polynomials, and the Stirling convolution polynomials.

An initial listing of special mathematical series is found here. A number of useful and special sequence generating functions are found in Section 5.4 and 7.4 of *Concrete Mathematics* and in Section 2.5 of Wilf's *Generatingfunctionology*. Other special generating functions of note include the entries in the next table, which is by no means complete.^{[29]}

This section needs expansion with: Lists of special and special sequence generating functions. The next table is a start. You can help by adding to it. (April 2017)

Formal power series Generating-function formula Notes is a first-order harmonic number is a Bernoulli number is a Fibonacci number and denotes the rising factorial, or Pochhammer symbol and some integer is the polylogarithm function and is a generalized harmonic number for is a Stirling number of the second kind and where the individual terms in the expansion satisfy The two-variable case is given by

George Pólya writes in *Mathematics and plausible reasoning*:

The name "generating function" is due to Laplace. Yet, without giving it a name, Euler used the device of generating functions long before Laplace [..]. He applied this mathematical tool to several problems in Combinatory Analysis and the Theory of Numbers.