Generating function

In mathematics, a generating function is a representation of an infinite sequence of numbers as the coefficients of a formal power series. 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. 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, in that a series of terms can be said to be the generator of its sequence of term coefficients.

Ordinary generating function (OGF)
The ordinary generating function of a sequence $a_{n}$ is

$$G(a_n;x)=\sum_{n=0}^\infty a_n x^n.$$

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

$$G(a_{m,n};x,y)=\sum_{m,n=0}^\infty a_{m,n} x^m y^n.$$

Exponential generating function (EGF)
The exponential generating function of a sequence $a_{n}$ is

$$\operatorname{EG}(a_n;x)=\sum_{n=0}^\infty a_n \frac{x^n}{n!}.$$

Exponential generating functions are generally more convenient than ordinary generating functions for combinatorial enumeration problems that involve labelled objects.

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 $f_{n+2} = f_{n+1} + f_{n}$. The corresponding exponential generating function has the form

$$\operatorname{EF}(x) = \sum_{n=0}^\infty \frac{f_n}{n!} x^n$$

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}$.

Poisson generating function
The Poisson generating function of a sequence $a_{n}$ is

$$\operatorname{PG}(a_n;x)=\sum _{n=0}^\infty a_n e^{-x} \frac{x^n}{n!} = e^{-x}\, \operatorname{EG}(a_n;x).$$

Lambert series
The Lambert series of a sequence $a_{n}$ is

$$\operatorname{LG}(a_n;x)=\sum _{n=1}^\infty a_n \frac{x^n}{1-x^n}.$$

The Lambert series coefficients in the power series expansions

$$b_n := [x^n] \operatorname{LG}(a_n;x)$$

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

$$b_n = \sum_{d|n} a_d.$$

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.

Bell series
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

$$\operatorname{BG}_p(a_n;x) = \sum_{n=0}^\infty a_{p^n}x^n.$$

Dirichlet series generating functions (DGFs)
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

$$\operatorname{DG}(a_n;s)=\sum _{n=1}^\infty \frac{a_n}{n^s}.$$

The Dirichlet series generating function is especially useful when $a_{n}$ is a multiplicative function, in which case it has an Euler product expression in terms of the function's Bell series

$$\operatorname{DG}(a_n;s)=\prod_{p} \operatorname{BG}_p(a_n;p^{-s})\,.$$

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

$$[x^n] \operatorname{LG}(a_n; x) = b_n$$

if and only if

$$\operatorname{DG}(a_n;s) \zeta(s) = \operatorname{DG}(b_n;s),$$

where $ζ(s)$ is the Riemann zeta function.

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

$$e^{xf(t)}=\sum_{n=0}^\infty \frac{p_n(x)}{n!} t^n$$

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.

Examples of generating functions for simple sequences
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

$$\sum_{n=0}^\infty x^n= \frac{1}{1-x}.$$

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$:

$$\sum_{n=0}^\infty(ax)^n= \frac{1}{1-ax}.$$

(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,

$$\sum_{n=0}^\infty(-1)^nx^n= \frac{1}{1+x}.$$

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

$$\sum_{n=0}^\infty x^{2n} = \frac{1}{1-x^2}.$$

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

$$\sum_{n=0}^\infty(n+1)x^n= \frac{1}{(1-x)^2},$$

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

$$\sum_{n=0}^\infty\binom{n+2}2 x^n= \frac{1}{(1-x)^3}.$$

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

$$\sum_{n=0}^\infty a^n\binom{n+k}k x^n= \frac{1}{(1-ax)^{k+1}}\,.$$

Since

$$2\binom{n+2}2 - 3\binom{n+1}1 + \binom{n}0 = 2\frac{(n+1)(n+2)}2 -3(n+1) + 1 = n^2,$$

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:

$$G(n^2;x) = \sum_{n=0}^\infty n^2x^n = \frac{2}{(1-x)^3} - \frac{3}{(1-x)^2} + \frac{1}{1-x} = \frac{x(x+1)}{(1-x)^3}.$$

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:

$$\begin{align} G(n^2;x) & = \sum_{n=0}^\infty n^2x^n \\[4px] & = \sum_{n=0}^\infty n(n-1) x^n + \sum_{n=0}^\infty n x^n \\[4px] & = x^2 D^2\left[\frac{1}{1-x}\right] + x D\left[\frac{1}{1-x}\right] \\[4px] & = \frac{2 x^2}{(1-x)^3} + \frac{x}{(1-x)^2} =\frac{x(x+1)}{(1-x)^3}. \end{align}$$

By induction, we can similarly show for positive integers $m ≥ 1$ that

$$n^m = \sum_{j=0}^m \begin{Bmatrix} m \\ j \end{Bmatrix} \frac{n!}{(n-j)!}, $$

where ${}}n k{{resize|150%|}$ denote the Stirling numbers of the second kind and where the generating function

$$\sum_{n = 0}^\infty \frac{n!}{ (n-j)!} \, z^n = \frac{j! \cdot z^j}{(1-z)^{j+1}},$$

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

$$\frac{z^k}{(1-z)^{k+1}} = \sum_{i=0}^k \binom{k}{i} \frac{(-1)^{k-i}}{(1-z)^{i+1}},$$

we can apply a well-known finite sum identity involving the Stirling numbers to obtain that

$$\sum_{n = 0}^\infty n^m z^n = \sum_{j=0}^m \begin{Bmatrix} m+1 \\ j+1 \end{Bmatrix} \frac{(-1)^{m-j} j!}{(1-z)^{j+1}}. $$

Rational functions
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

$$f_n = p_1(n) \rho_1^n + \cdots + p_\ell(n) \rho_\ell^n, $$

where the reciprocal roots, $$\rho_i \isin \mathbb{C}$$, 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

$$F(s, t) := \sum_{m,n \geq 0} f(m, n) w^m z^n$$

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

$$\operatorname{diag}(F) := \sum_{n = 0}^\infty f(n, n) z^n,$$

is algebraic. For example, if we let

$$F(s, t) := \sum_{i,j \geq 0} \binom{i+j}{i} s^i t^j = \frac{1}{1-s-t}, $$

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

$$\operatorname{diag}(F) = \sum_{n = 0}^\infty \binom{2n}{n} z^n = \frac{1}{\sqrt{1-4z}}. $$

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.

Multiplication yields convolution
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) $$(a_0, a_0 + a_1, a_0 + a_1 + a_2, \ldots)$$ of a sequence with ordinary generating function $G(a_{n}; x)$ has the generating function $$G(a_n; x) \cdot \frac{1}{1-x}$$ because $1⁄1 − x$ is the ordinary generating function for the sequence (1, 1, ...). See also the section on convolutions in the applications section of this article below for further examples of problem solving with convolutions of generating functions and interpretations.

Shifting sequence indices
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:

$$\begin{align} & z^m G(z) = \sum_{n = m}^\infty g_{n-m} z^n \\[4px] & \frac{G(z) - g_0 - g_1 z - \cdots - g_{m-1} z^{m-1}}{z^m} = \sum_{n = 0}^\infty g_{n+m} z^n. \end{align}$$

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

$$\begin{align} G'(z) & = \sum_{n = 0}^\infty (n+1) g_{n+1} z^n \\[4px] z \cdot G'(z) & = \sum_{n = 0}^\infty n g_{n} z^n \\[4px] \int_0^z G(t) \, dt & = \sum_{n = 1}^\infty \frac{g_{n-1}}{n} z^n. \end{align}$$

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 $k$th falling factorial:

$$ z^k G^{(k)}(z) = \sum_{n = 0}^\infty n^\underline{k} g_n z^n = \sum_{n = 0}^\infty n (n-1) \dotsb (n-k+1) g_n z^n \quad\text{for all } k \in \mathbb{N}. $$

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

$$ \sum_{j=0}^k \begin{Bmatrix} k \\ j \end{Bmatrix} z^j F^{(j)}(z) = \sum_{n = 0}^\infty n^k f_n z^n \quad\text{for all } k \in \mathbb{N}. $$

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.

Enumerating arithmetic progressions of sequences
In this section we give formulas for generating functions enumerating the sequence ${f_{an + b}} |undefined$ 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):

$$\begin{align} \sum_{n = 0}^\infty f_{2n} z^{2n} &= \frac{F(z) + F(-z)}{2} \\[4px] \sum_{n = 0}^\infty f_{2n+1} z^{2n+1} &= \frac{F(z) - F(-z)}{2}. \end{align}$$

More generally, suppose that $a ≥ 3$ and that $ω_{a} = exp 2πi⁄a$ denotes the $a$th primitive root of unity. Then, as an application of the discrete Fourier transform, we have the formula

$$\sum_{n = 0}^\infty f_{an+b} z^{an+b} = \frac{1}{a} \sum_{m=0}^{a-1} \omega_a^{-mb} F\left(\omega_a^m z\right).$$

For integers $m ≥ 1$, another useful formula providing somewhat reversed floored arithmetic progressions — effectively repeating each coefficient $m$ times — are generated by the identity $$\sum_{n = 0}^\infty f_{\left\lfloor \frac{n}{m} \right\rfloor} z^n = \frac{1-z^m}{1-z} F(z^m) = \left(1 + z + \cdots + z^{m-2} + z^{m-1}\right) F(z^m).$$

Definitions
A formal power series (or function) $P$ is said to be holonomic if it satisfies a linear differential equation of the form

$$c_0(z) F^{(r)}(z) + c_1(z) F^{(r-1)}(z) + \cdots + c_r(z) F(z) = 0, $$

where the coefficients $F(z)$ are in the field of rational functions, $$\mathbb{C}(z)$$. Equivalently, $$F(z)$$ is holonomic if the vector space over $$\mathbb{C}(z)$$ spanned by the set of all of its derivatives is finite dimensional.

Since we can clear denominators if need be in the previous equation, we may assume that the functions, $c_{i}(z)$ are polynomials in $z$. Thus we can see an equivalent condition that a generating function is holonomic if its coefficients satisfy a $P$-recurrence of the form

$$\widehat{c}_s(n) f_{n+s} + \widehat{c}_{s-1}(n) f_{n+s-1} + \cdots + \widehat{c}_0(n) f_n = 0,$$

for all large enough $c_{i}(z)$ and where the $n ≥ n_{0}$ are fixed finite-degree polynomials in $n$. In other words, the properties that a sequence be $P$-recursive and have a holonomic generating function are equivalent. Holonomic functions are closed under the Hadamard product operation $ĉ_{i}(n)$ on generating functions.

Examples
The functions $⊙$, $e^{z}$, $log z$, $cos z$, $$\sqrt{1 + z}$$, the dilogarithm function $arcsin z$, the generalized hypergeometric functions $Li_{2}(z)$ and the functions defined by the power series

$$\sum_{n = 0}^\infty \frac{z^n}{(n!)^2}$$

and the non-convergent

$$\sum_{n = 0}^\infty n! \cdot z^n$$

are all holonomic.

Examples of $P$-recursive sequences with holonomic generating functions include $_{p}F_{q}(...; ...; z)$ and $f_{n} ≔ 1⁄n + 1 (2n n)$, where sequences such as $$\sqrt{n}$$ and $f_{n} ≔ 2^{n}⁄n^{2} + 1$ are not $P$-recursive due to the nature of singularities in their corresponding generating functions. Similarly, functions with infinitely many singularities such as $log n$, $tan z$, and $sec z$ are not holonomic functions.

Software for working with $P$-recursive sequences and holonomic generating 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 $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. Other packages listed on this particular RISC site are targeted at working with holonomic generating functions specifically.

Relation to discrete-time Fourier transform
When the series converges absolutely, $$G \left ( a_n; e^{-i \omega} \right) = \sum_{n=0}^\infty a_n e^{-i \omega n}$$ is the discrete-time Fourier transform of the sequence $Γ(z)$.

Asymptotic growth of a 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 $a_{0}, a_{1}, ...$ that has a finite radius of convergence of $r$ can be written as

$$G(a_n; x) = \frac{A(x) + B(x) \left (1- \frac{x}{r} \right )^{-\beta}}{x^\alpha}$$

where each of $G(a_{n}; x)$ and $A(x)$ is a function that is analytic to a radius of convergence greater than $r$ (or is entire), and where $B(x)$ then

$$a_n \sim \frac{B(r)}{r^\alpha \Gamma(\beta)} \, n^{\beta-1}\left(\frac{1}{r}\right)^n \sim \frac{B(r)}{r^{\alpha}} \binom{n+\beta-1}{n}\left(\frac{1}{r}\right)^n = \frac{B(r)}{r^\alpha} \left(\!\!\binom{\beta}{n}\!\!\right)\left(\frac{1}{r}\right)^n\,,$$ 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 $B(r) ≠ 0$. In particular,

$$G\left(a_n - \frac{B(r)}{r^\alpha} \binom{n+\beta-1}{n}\left(\frac{1}{r}\right)^n; x \right) = G(a_n; x) - \frac{B(r)}{r^\alpha} \left(1 - \frac{x}{r}\right)^{-\beta}\,.$$

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}$ 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.

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

$$G(n^2; x) = \frac{x(x+1)}{(1-x)^3}.$$

With $a_{n}⁄n!$, $r = 1$, $α = −1$, $β = 3$, and $A(x) = 0$, we can verify that the squares grow as expected, like the squares:

$$a_n \sim \frac{B(r)}{r^\alpha \Gamma(\beta)} \, n^{\beta-1} \left (\frac{1}{r} \right)^n = \frac{1+1}{1^{-1}\,\Gamma(3)}\,n^{3-1} \left(\frac1 1\right)^n = n^2.$$

Asymptotic growth of the Catalan numbers
The ordinary generating function for the Catalan numbers is

$$G(C_n; x) = \frac{1-\sqrt{1-4x}}{2x}.$$

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

$$C_n \sim \frac{B(r)}{r^\alpha \Gamma(\beta)} \, n^{\beta-1} \left(\frac{1}{r} \right)^n = \frac{-\frac12}{\left(\frac14\right)^1 \Gamma\left(-\frac12\right)} \, n^{-\frac12-1} \left(\frac{1}{\,\frac14\,}\right)^n = \frac{4^n}{n^\frac32 \sqrt\pi}.$$

Bivariate and multivariate generating functions
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 $B(x) = −1⁄2$ 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 $(1 + x)^{n}$ for all $k$ and $n$. To do this, consider $(n k)$ 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 $(1 + x)^{n}$ is

$$\frac{1}{1-ay},$$

the generating function for the binomial coefficients is:

$$\sum_{n,k} \binom{n}{k} x^k y^n = \frac{1}{1-(1+x)y}=\frac{1}{1-y-xy}.$$

Definitions
Expansions of (formal) Jacobi-type and Stieltjes-type continued fractions ($J$-fractions and $J$-fractions, respectively) whose $S$th rational convergents represent $a^{n}$-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 ($h$-fractions) are expanded as in the following equation and have the next corresponding power series expansions with respect to $J$ for some specific, application-dependent component sequences, $2h$ and ${ab_{i}} |undefined$, where ${c_{i}} |undefined$ denotes the formal variable in the second power series expansion given below:

$$\begin{align} J^{[\infty]}(z) & = \cfrac{1}{1-c_1 z-\cfrac{\text{ab}_2 z^2}{1-c_2 z-\cfrac{\text{ab}_3 z^2}{\ddots}}} \\[4px] & = 1 + c_1 z + \left(\text{ab}_2+c_1^2\right) z^2 + \left(2 \text{ab}_2 c_1+c_1^3 + \text{ab}_2 c_2\right) z^3 + \cdots \end{align}$$

The coefficients of $$z^n$$, denoted in shorthand by $z ≠ 0$, in the previous equations correspond to matrix solutions of the equations

$$\begin{bmatrix}k_{0,1} & k_{1,1} & 0 & 0 & \cdots \\ k_{0,2} & k_{1,2} & k_{2,2} & 0 & \cdots \\ k_{0,3} & k_{1,3} & k_{2,3} & k_{3,3} & \cdots \\ \vdots & \vdots & \vdots & \vdots \end{bmatrix} = \begin{bmatrix}k_{0,0} & 0 & 0 & 0 & \cdots \\ k_{0,1} & k_{1,1} & 0 & 0 & \cdots \\ k_{0,2} & k_{1,2} & k_{2,2} & 0 & \cdots \\ \vdots & \vdots & \vdots & \vdots \end{bmatrix} \cdot \begin{bmatrix}c_1 & 1 & 0 & 0 & \cdots \\ \text{ab}_2 & c_2 & 1 & 0 & \cdots \\ 0 & \text{ab}_3 & c_3 & 1 & \cdots \\ \vdots & \vdots & \vdots & \vdots \end{bmatrix}, $$

where $j_{n} ≔ [z^{n}] J^{[∞]}(z)$, $j_{0} ≡ k_{0,0} = 1$ for $j_{n} = k_{0,n}$, $n ≥ 1$ if $k_{r,s} = 0$, and where for all integers $r > s$, we have an addition formula relation given by

$$j_{p+q} = k_{0,p} \cdot k_{0,q} + \sum_{i=1}^{\min(p, q)} \text{ab}_2 \cdots \text{ab}_{i+1} \times k_{i,p} \cdot k_{i,q}. $$

Properties of the $z$th convergent functions
For $p, q ≥ 0$ (though in practice when $h ≥ 0$), we can define the rational $J$th convergents to the infinite $h$-fraction, $h ≥ 2$, expanded by

$$\operatorname{Conv}_h(z) := \frac{P_h(z)}{Q_h(z)} = j_0 + j_1 z + \cdots + j_{2h-1} z^{2h-1} + \sum_{n = 2h}^\infty \widetilde{j}_{h,n} z^n$$

component-wise through the sequences, $J^{[∞]}(z)$ and $P_{h}(z)$, defined recursively by

$$\begin{align} P_h(z) & = (1-c_h z) P_{h-1}(z) - \text{ab}_h z^2 P_{h-2}(z) + \delta_{h,1} \\ Q_h(z) & = (1-c_h z) Q_{h-1}(z) - \text{ab}_h z^2 Q_{h-2}(z) + (1-c_1 z) \delta_{h,1} + \delta_{0,1}. \end{align}$$

Moreover, the rationality of the convergent function $Q_{h}(z)$ for all $Conv_{h}(z)$ implies additional finite difference equations and congruence properties satisfied by the sequence of $h ≥ 2$, and for $j_{n}$ if $M_{h} ≔ ab_{2} ⋯ ab_{h + 1}$ then we have the congruence

$$j_n \equiv [z^n] \operatorname{Conv}_h(z) \pmod h, $$

for non-symbolic, determinate choices of the parameter sequences $h ‖ M_{h}$ and ${ab_{i}} |undefined$ when ${c_{i}} |undefined$, that is, when these sequences do not implicitly depend on an auxiliary parameter such as $h$, $J$, or $q$ as in the examples contained in the table below.

Examples
The next table provides examples of closed-form formulas for the component sequences found computationally (and subsequently proved correct in the cited references ) in several special cases of the prescribed sequences, $h ≥ 2$, generated by the general expansions of the $x$-fractions defined in the first subsection. Here we define $j_{n}$ and the parameters $$R, \alpha \isin \mathbb{Z}^+$$ and $R$ to be indeterminates with respect to these expansions, where the prescribed sequences enumerated by the expansions of these $J$-fractions are defined in terms of the $x$-Pochhammer symbol, Pochhammer symbol, and the binomial coefficients.


 * {| class="wikitable"

! $$j_n$$ !! $$c_1$$ !! $$c_i (i \geq 2)$$ !! $$\mathrm{ab}_i (i \geq 2)$$
 * $$q^{n^2}$$ || $$q$$ || $$q^{2h-3}\left(q^{2h}+q^{2h-2}-1\right)$$ || $$q^{6h-10}\left(q^{2h-2}-1\right)$$
 * $$(a; q)_n$$ || $$1-a$$ || $$q^{h-1} - a q^{h-2} \left(q^{h} + q^{h-1} - 1\right)$$ || $$a q^{2h-4} \left(a q^{h-2}-1\right)\left(q^{h-1}-1\right)$$
 * $$\left(z q^{-n}; q\right)_n$$ || $$\frac{q-z}{q}$$ || $$\frac{q^h - z - qz + q^h z}{q^{2h-1}}$$ || $$\frac{\left(q^{h-1}-1\right) \left(q^{h-1}-z\right) \cdot z}{q^{4h-5}}$$
 * $$\frac{(a; q)_n}{(b; q)_n}$$ || $$\frac{1-a}{1-b}$$ || $$\frac{q^{i-2}\left(q+ab q^{2i-3}+a(1-q^{i-1}-q^i)+b(q^{i}-q-1)\right)}{\left(1-bq^{2i-4}\right)\left(1-bq^{2i-2}\right)}$$ || $$\frac{q^{2i-4}\left(1-bq^{i-3}\right)\left(1-aq^{i-2}\right)\left(a-bq^{i-2}\right)\left(1-q^{i-1}\right)}{\left(1-bq^{2i-5}\right)\left(1-bq^{2i-4}\right)^2\left(1-bq^{2i-3}\right)}$$
 * $$\alpha^n \cdot \left(\frac{R}{\alpha}\right)_n$$ || $$R$$ || $$R+2\alpha (i-1)$$ || $$(i-1)\alpha\bigl(R+(i-2)\alpha\bigr)$$
 * $$(-1)^n \binom{x}{n}$$ || $$-x$$ || $$-\frac{(x+2(i-1)^2)}{(2i-1)(2i-3)}$$
 * $$\begin{cases}-\dfrac{(x-i+2)(x+i-1)}{4 \cdot (2i-3)^2} & \text{for }i \geq 3; \\[4px] -\frac{1}{2}x(x+1) & \text{for }i = 2. \end{cases}$$
 * $$(-1)^n \binom{x+n}{n}$$ || $$-(x+1)$$ || $$\frac{\bigl(x-2i(i-2)-1\bigr)}{(2i-1)(2i-3)}$$
 * $$\begin{cases}-\dfrac{(x-i+2)(x+i-1)}{4 \cdot (2i-3)^2} & \text{for }i \geq 3; \\[4px] -\frac{1}{2}x(x+1) & \text{for }i = 2. \end{cases}$$
 * }
 * $$(-1)^n \binom{x}{n}$$ || $$-x$$ || $$-\frac{(x+2(i-1)^2)}{(2i-1)(2i-3)}$$
 * $$\begin{cases}-\dfrac{(x-i+2)(x+i-1)}{4 \cdot (2i-3)^2} & \text{for }i \geq 3; \\[4px] -\frac{1}{2}x(x+1) & \text{for }i = 2. \end{cases}$$
 * $$(-1)^n \binom{x+n}{n}$$ || $$-(x+1)$$ || $$\frac{\bigl(x-2i(i-2)-1\bigr)}{(2i-1)(2i-3)}$$
 * $$\begin{cases}-\dfrac{(x-i+2)(x+i-1)}{4 \cdot (2i-3)^2} & \text{for }i \geq 3; \\[4px] -\frac{1}{2}x(x+1) & \text{for }i = 2. \end{cases}$$
 * }
 * $$\begin{cases}-\dfrac{(x-i+2)(x+i-1)}{4 \cdot (2i-3)^2} & \text{for }i \geq 3; \\[4px] -\frac{1}{2}x(x+1) & \text{for }i = 2. \end{cases}$$
 * }

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.

Examples
Generating functions for the sequence of square numbers $0 < |a|, |b|, |q| < 1$ are:

Ordinary generating function
$$G(n^2;x)=\sum_{n=0}^\infty n^2x^n = \frac{x(x+1)}{(1-x)^3}$$

Exponential generating function
$$\operatorname{EG}(n^2;x)=\sum _{n=0}^\infty \frac{n^2x^n}{n!}=x(x+1)e^x$$

Lambert series
As an example of a Lambert series identity not given in the main article, we can show that for $a_{n} = n^{2}$ we have that

$$\sum_{n = 1}^\infty \frac{q^n x^n}{1-x^n} = \sum_{n = 1}^\infty \frac{q^n x^{n^2}}{1-q x^n} + \sum_{n = 1}^\infty \frac{q^n x^{n(n+1)}}{1-x^n}, $$

where we have the special case identity for the generating function of the divisor function, $|x|, |xq| < 1$, given by

$$\sum_{n = 1}^\infty \frac{x^n}{1-x^n} = \sum_{n = 1}^\infty \frac{x^{n^2} \left(1+x^n\right)}{1-x^n}. $$

Bell series
$$\operatorname{BG}_p\left(n^2;x\right)=\sum_{n=0}^\infty \left(p^{n}\right)^2x^n=\frac{1}{1-p^2x}$$

Dirichlet series generating function
$$\operatorname{DG}\left(n^2;s\right)=\sum_{n=1}^\infty \frac{n^2}{n^s}=\zeta(s-2),$$

using the Riemann zeta function.

The sequence $q$ generated by a Dirichlet series generating function (DGF) corresponding to:

$$\operatorname{DG}(a_k;s)=\zeta(s)^m$$

where $d(n) ≡ σ_{0}(n)$ is the Riemann zeta function, has the ordinary generating function:

$$\sum_{k=1}^{k=n} a_k x^k = x + \binom{m}{1} \sum_{2 \leq a \leq n} x^{a} + \binom{m}{2}\underset{ab \leq n}{\sum_{a = 2}^\infty \sum_{b = 2}^\infty} x^{ab} + \binom{m}{3}\underset{abc \leq n}{\sum_{a = 2}^\infty \sum_{c = 2}^\infty \sum_{b = 2}^\infty} x^{abc} + \binom{m}{4}\underset{abcd \leq n}{\sum_{a = 2}^\infty \sum_{b = 2}^\infty \sum_{c = 2}^\infty \sum_{d = 2}^\infty} x^{abcd} + \cdots$$

Multivariate generating functions
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 $J$ rows and $a_{k}$ columns; the row sums are $ζ(s)$ and the column sums are $t_{1}, t_{2} ... t_{r}$. Then, according to I. J. Good, the number of such tables is the coefficient of

$$x_1^{t_1}\cdots x_r^{t_r}y_1^{s_1}\cdots y_c^{s_c}$$

in

$$\prod_{i=1}^{r}\prod_{j=1}^c\frac{1}{1-x_iy_j}.$$

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

$$G(w, z) := \sum_{m,n \geq 0} g_{m,n} w^m z^n$$

include the following two-variable generating functions for the binomial coefficients, the Stirling numbers, and the Eulerian numbers:

$$\begin{align} e^{z+wz} & = \sum_{m,n \geq 0} \binom{n}{m} w^m \frac{z^n}{n!} \\[4px] e^{w(e^z-1)} & = \sum_{m,n \geq 0} \begin{Bmatrix} n \\ m \end{Bmatrix} w^m \frac{z^n}{n!} \\[4px] \frac{1}{(1-z)^w} & = \sum_{m,n \geq 0} \begin{bmatrix} n \\ m \end{bmatrix} w^m \frac{z^n}{n!} \\[4px] \frac{1-w}{e^{(w-1)z}-w} & = \sum_{m,n \geq 0} \left\langle\begin{matrix} n \\ m \end{matrix} \right\rangle w^m \frac{z^n}{n!} \\[4px] \frac{e^w-e^z}{w e^z-z e^w} &= \sum_{m,n \geq 0} \left\langle\begin{matrix} m+n+1 \\ m \end{matrix} \right\rangle \frac{w^m z^n}{(m+n+1)!}. \end{align}$$

Example 1: A formula for sums of harmonic numbers
Generating functions give us several methods to manipulate sums and to establish identities between sums.

The simplest case occurs when $s_{1}, s_{2} ... s_{c}$. We then know that $s_{n} = Σn k = 0 a_{k}$ for the corresponding ordinary generating functions.

For example, we can manipulate $$s_n=\sum_{k=1}^{n} H_{k}\,,$$ where $S(z) = A(z)⁄1 − z$ are the harmonic numbers. Let $$H(z) = \sum_{n = 1}^\infty{H_n z^n}$$ be the ordinary generating function of the harmonic numbers. Then $$H(z) = \frac{1}{1-z}\sum_{n = 1}^\infty \frac{z^n}{n}\,,$$ and thus $$S(z) = \sum_{n = 1}^\infty{s_n z^n} = \frac{1}{(1-z)^2}\sum_{n = 1}^\infty \frac{z^n}{n}\,.$$

Using $$\frac{1}{(1-z)^2} = \sum_{n = 0}^\infty (n+1)z^n\,,$$ convolution with the numerator yields $$s_n = \sum_{k = 1}^{n} \frac{n+1-k}{k} = (n+1)H_n - n\,,$$ which can also be written as $$\sum_{k = 1}^{n}{H_k} = (n+1)(H_{n+1} - 1)\,.$$

Example 2: Modified binomial coefficient sums and the binomial transform
As another example of using generating functions to relate sequences and manipulate sums, for an arbitrary sequence $H_{k} = 1 + 1⁄2 + ⋯ + 1⁄k$ we define the two sequences of sums $$\begin{align} s_n &:= \sum_{m=0}^n \binom{n}{m} f_m 3^{n-m} \\[4px] \tilde{s}_n &:= \sum_{m=0}^n \binom{n}{m} (m+1)(m+2)(m+3) f_m 3^{n-m}\,, \end{align}$$ for all $⟨ f_{n} ⟩$, and seek to express the second sums in terms of the first. We suggest an approach by generating functions.

First, we use the binomial transform to write the generating function for the first sum as $$S(z) = \frac{1}{1-3z} F\left(\frac{z}{1-3z}\right). $$

Since the generating function for the sequence $n ≥ 0$ is given by $$6 F(z) + 18z F'(z) + 9z^2 F(z) + z^3 F'(z)$$ we may write the generating function for the second sum defined above in the form $$\tilde{S}(z) = \frac{6}{(1-3z)} F\left(\frac{z}{1-3z}\right)+\frac{18z}{(1-3z)^2} F'\left(\frac{z}{1-3z}\right)+\frac{9z^2}{(1-3z)^3} F\left(\frac{z}{1-3z}\right)+\frac{z^3}{(1-3z)^4} F'\left(\frac{z}{1-3z}\right). $$

In particular, we may write this modified sum generating function in the form of $$a(z) \cdot S(z) + b(z) \cdot z S'(z) + c(z) \cdot z^2 S(z) + d(z) \cdot z^3 S'(z), $$ for $⟨ (n + 1)(n + 2)(n + 3) f_{n} ⟩$, $a(z) = 6(1 − 3z)^{3}$, $b(z) = 18(1 − 3z)^{3}$, and $c(z) = 9(1 − 3z)^{3}$, where $d(z) = (1 − 3z)^{3}$.

Finally, it follows that we may express the second sums through the first sums in the following form: $$\begin{align} \tilde{s}_n & = [z^n]\left(6(1-3z)^3 \sum_{n = 0}^\infty s_n z^n + 18 (1-3z)^3 \sum_{n = 0}^\infty n s_n z^n + 9 (1-3z)^3 \sum_{n = 0}^\infty n(n-1) s_n z^n + (1-3z)^3 \sum_{n = 0}^\infty n(n-1)(n-2) s_n z^n\right) \\[4px] & = (n+1)(n+2)(n+3) s_n - 9 n(n+1)(n+2) s_{n-1} + 27 (n-1)n(n+1) s_{n-2} - (n-2)(n-1)n s_{n-3}. \end{align}$$

Example 3: Generating functions for mutually recursive sequences
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 $(1 − 3z)^{3} = 1 − 9z + 27z^{2} − 27z^{3}$) to tile a 3-by-$r$ rectangle with unmarked 2-by-1 domino pieces. Let the auxiliary sequence, $U_{n}$, be defined as the number of ways to cover a 3-by-$c$ rectangle-minus-corner section of the full rectangle. We seek to use these definitions to give a closed form formula for $V_{n}$ without breaking down this definition further to handle the cases of vertical versus horizontal dominoes. Notice that the ordinary generating functions for our two sequences correspond to the series

$$\begin{align} U(z) = 1 + 3z^2 + 11 z^4 + 41 z^6 + \cdots, \\ V(z) = z + 4z^3 + 15 z^5 + 56 z^7 + \cdots. \end{align}$$

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 $U_{n}$ defined as above where $n ≥ 2$, $U_{0} = 1$, $U_{1} = 0$, and $V_{0} = 0$: $$\begin{align} U_n & = 2 V_{n-1} + U_{n-2} \\ V_n & = U_{n-1} + V_{n-2}. \end{align}$$

Since we have that for all integers $V_{1} = 1$, the index-shifted generating functions satisfy $$z^m G(z) = \sum_{n = m}^\infty g_{n-m} z^n\,,$$ 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 $$\begin{align} U(z) & = 2z V(z) + z^2 U(z) + 1 \\ V(z) & = z U(z) + z^2 V(z) = \frac{z}{1-z^2} U(z), \end{align}$$ which then implies by solving the system of equations (and this is the particular trick to our method here) that $$U(z) = \frac{1-z^2}{1-4z^2+z^4} = \frac{1}{3-\sqrt{3}} \cdot \frac{1}{1-\left(2+\sqrt{3}\right) z^2} + \frac{1}{3 + \sqrt{3}} \cdot \frac{1}{1-\left(2-\sqrt{3}\right) z^2}. $$

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 $m ≥ 0$ and that $$U_{2n} = \left\lceil \frac{\left(2+\sqrt{3}\right)^n}{3-\sqrt{3}} \right\rceil\,, $$ for all integers $m < 0$. We also note that the same shifted generating function technique applied to the second-order recurrence for the Fibonacci numbers is the prototypical example of using generating functions to solve recurrence relations in one variable already covered, or at least hinted at, in the subsection on rational functions given above.

Convolution (Cauchy products)
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).


 * 1) Consider $U_{2n + 1} ≡ 0$ and $n ≥ 0$ are ordinary generating functions. $$C(z) = A(z)B(z) \Leftrightarrow [z^n]C(z) = \sum_{k=0}^{n}{a_k b_{n-k}}$$
 * 2) Consider $A(z)$ and $B(z)$ are exponential generating functions. $$C(z) = A(z)B(z) \Leftrightarrow \left[\frac{z^n}{n!}\right]C(z) = \sum_{k=0}^n \binom{n}{k} a_k b_{n-k}$$
 * 3) Consider the triply convolved sequence resulting from the product of three ordinary generating functions $$C(z) = F(z) G(z) H(z) \Leftrightarrow [z^n]C(z) = \sum_{j+k+ l=n} f_j g_k h_ l$$
 * 4) Consider the $n$-fold convolution of a sequence with itself for some positive integer $A(z)$ (see the example below for an application) $$C(z) = G(z)^m \Leftrightarrow [z^n]C(z) = \sum_{k_1+k_2+\cdots+k_m=n} g_{k_1} g_{k_2} \cdots g_{k_m}$$

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 $n$ is denoted by $B(z)$, then we can show that for any two random variables $$G_{X+Y}(z) = G_X(z) G_Y(z)\,, $$ if $m$ and $Z$ are independent. Similarly, the number of ways to pay $m ≥ 1$ cents in coin denominations of values in the set {1, 5, 10, 25, 50} (i.e., in pennies, nickels, dimes, quarters, and half dollars, respectively) is generated by the product $$C(z) = \frac{1}{1-z} \frac{1}{1-z^5} \frac{1}{1-z^{10}} \frac{1}{1-z^{25}} \frac{1}{1-z^{50}}, $$ and moreover, if we allow the $X$ 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 $Y$-Pochhammer symbol product of $$\prod_{n = 1}^\infty \left(1 - z^n\right)^{-1}\,.$$

Example: The generating function for the Catalan numbers
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, $G_{Z}(z)$. In particular, this sequence has the combinatorial interpretation as being the number of ways to insert parentheses into the product $n ≥ 0$ so that the order of multiplication is completely specified. For example, $C_{n}$ which corresponds to the two expressions $x_{0} · x_{1} ·⋯· x_{n}$ and $C_{2} = 2$. It follows that the sequence satisfies a recurrence relation given by $$C_n = \sum_{k=0}^{n-1} C_k C_{n-1-k} + \delta_{n,0} = C_0 C_{n-1} + C_1 C_{n-2} + \cdots + C_{n-1} C_0 + \delta_{n,0}\,,\quad n \geq 0\,, $$ and so has a corresponding convolved generating function, $x_{0} · (x_{1} · x_{2})$, satisfying $$C(z) = z \cdot C(z)^2 + 1\,.$$

Since $(x_{0} · x_{1}) · x_{2}$, we then arrive at a formula for this generating function given by $$C(z) = \frac{1-\sqrt{1-4z}}{2z} = \sum_{n = 0}^\infty \frac{1}{n+1}\binom{2n}{n} z^n\,.$$

Note that the first equation implicitly defining $C(z)$ above implies that $$C(z) = \frac{1}{1-z \cdot C(z)} \,, $$ which then leads to another "simple" (of form) continued fraction expansion of this generating function.

Example: Spanning trees of fans and convolutions of convolutions
A fan of order $n$ is defined to be a graph on the vertices $C(0) = 1 ≠ ∞$ with $C(z)$ edges connected according to the following rules: Vertex 0 is connected by a single edge to each of the other $q$ vertices, and vertex $$k$$ is connected by a single edge to the next vertex ${0, 1, ..., n}$ for all $2n − 1$. 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 $k + 1$ of a fan of order $n$ are possible for each $1 ≤ k < n$.

As an observation, we may approach the question by counting the number of ways to join adjacent sets of vertices. For example, when $f_{n}$, we have that $n ≥ 1$, which is a sum over the $n$-fold convolutions of the sequence $n = 4$ for $f_{4} = 4 + 3 · 1 + 2 · 2 + 1 · 3 + 2 · 1 · 1 + 1 · 2 · 1 + 1 · 1 · 2 + 1 · 1 · 1 · 1 = 21$. More generally, we may write a formula for this sequence as $$f_n = \sum_{m > 0} \sum_{\scriptstyle k_1+k_2+\cdots+k_m=n\atop\scriptstyle k_1, k_2, \ldots,k_m > 0} g_{k_1} g_{k_2} \cdots g_{k_m}\,, $$ from which we see that the ordinary generating function for this sequence is given by the next sum of convolutions as $$F(z) = G(z) + G(z)^2 + G(z)^3 + \cdots = \frac{G(z)}{1-G(z)} = \frac{z}{(1-z)^2-z} = \frac{z}{1-3z+z^2}\,,$$ from which we are able to extract an exact formula for the sequence by taking the partial fraction expansion of the last generating function.

Implicit generating functions and the Lagrange inversion formula
One often encounters generating functions specified by a functional equation, instead of an explicit specification. For example, the generating function $g_{n} = n = [z^{n}] z⁄(1 − z)^{2}$ for the number of binary trees on $m ≔ 1, 2, 3, 4$ nodes (leaves included) satisfies

The Lagrange Inversion Theorem is a tool used to explicitly evaluate solutions to such equations.

$n$

Applying the above theorem to our functional equation yields (with ):

Via the binomial theorem expansion, for even n, the formula returns 0. This is expected as one can prove that the number of leaves of a binary tree are one more than the number of its internal nodes, so the total sum should always be an odd number. For odd n, however, we get

The expression becomes much neater if we let n be the number of internal nodes: Now the expression just becomes the nth Catalan number.

Introducing a free parameter (snake oil method)
Sometimes the sum $T(z)$ 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 $m$ as limit in the summation. When n does not appear explicitly in the summation, we may consider $$ as a "free" parameter and treat $n$ as a coefficient of $s_{n}$, change the order of the summations on $n$ and $n$, and try to compute the inner sum.

For example, if we want to compute $$s_n = \sum_{k = 0}^\infty{\binom{n+k}{m+2k}\binom{2k}{k}\frac{(-1)^k}{k+1}}\,, \quad m,n \in \mathbb{N}_0\,,$$ we can treat $n$ as a "free" parameter, and set $$F(z) = \sum_{n = 0}^\infty{\left( \sum_{k = 0}^\infty{\binom{n+k}{m+2k}\binom{2k}{k}\frac{(-1)^k}{k+1}}\right) }z^n\,.$$

Interchanging summation ("snake oil") gives $$F(z) = \sum_{k = 0}^\infty{\binom{2k}{k}\frac{(-1)^k}{k+1} z^{-k}}\sum_{n = 0}^\infty{\binom{n+k}{m+2k} z^{n+k}}\,.$$

Now the inner sum is $s_{n}$. Thus $$\begin{align} F(z) &= \frac{z^m}{(1-z)^{m+1}}\sum_{k = 0}^\infty{\frac{1}{k+1}\binom{2k}{k}\left(\frac{-z}{(1-z)^2}\right)^k} \\[4px] &= \frac{z^m}{(1-z)^{m+1}}\sum_{k = 0}^\infty{C_k\left(\frac{-z}{(1-z)^2}\right)^k} &\text{where } C_k = k\text{th Catalan number} \\[4px] &= \frac{z^m}{(1-z)^{m+1}}\frac{1-\sqrt{1+\frac{4z}{(1-z)^2}}}{\frac{-2z}{(1-z)^2}} \\[4px] &= \frac{-z^{m-1}}{2(1-z)^{m-1}}\left(1-\frac{1+z}{1-z}\right) \\[4px] &= \frac{z^m}{(1-z)^m} = z\frac{z^{m-1}}{(1-z)^m}\,. \end{align}$$

Then we obtain $$s_n = \begin{cases} \displaystyle\binom{n-1}{m-1} & \text{for } m \geq 1 \,, \\ {} [n = 0] & \text{for } m = 0\,. \end{cases}$$

It is instructive to use the same method again for the sum, but this time take $k$ as the free parameter instead of $n$. We thus set $$G(z) = \sum_{m = 0}^\infty\left( \sum_{k = 0}^\infty \binom{n+k}{m+2k}\binom{2k}{k}\frac{(-1)^k}{k+1} \right) z^m\,.$$

Interchanging summation ("snake oil") gives $$G(z) = \sum_{k = 0}^\infty \binom{2k}{k}\frac{(-1)^k}{k+1} z^{-2k} \sum_{m = 0}^\infty \binom{n+k}{m+2k} z^{m+2k}\,.$$

Now the inner sum is $F(z) = Σ s_{n} z^{n}$. Thus $$\begin{align} G(z) &= (1+z)^n \sum_{k = 0}^\infty \frac{1}{k+1}\binom{2k}{k}\left(\frac{-(1+z)}{z^2}\right)^k \\[4px] &= (1+z)^n \sum_{k = 0}^\infty C_k \,\left(\frac{-(1+z)}{z^2}\right)^k &\text{where } C_k = k\text{th Catalan number} \\[4px] &= (1+z)^n \,\frac{1-\sqrt{1+\frac{4(1+z)}{z^2}}}{\frac{-2(1+z)}{z^2}} \\[4px] &= (1+z)^n \,\frac{z^2-z\sqrt{z^2+4+4z}}{-2(1+z)} \\[4px] &= (1+z)^n \,\frac{z^2-z(z+2)}{-2(1+z)} \\[4px] &= (1+z)^n \,\frac{-2z}{-2(1+z)} = z(1+z)^{n-1}\,. \end{align}$$

Thus we obtain $$s_n = \left[z^m\right] z(1+z)^{n-1} = \left[z^{m-1}\right] (1+z)^{n-1} = \binom{n-1}{m-1}\,,$$ for $z^{m + 2k}⁄(1 − z)^{m + 2k + 1}$ as before.

Generating functions prove congruences
We say that two generating functions (power series) are congruent modulo $m$, written $(1 + z)^{n + k}$ if their coefficients are congruent modulo $n$ for all $m ≥ 1$, i.e., $A(z) ≡ B(z) (mod m)$ for all relevant cases of the integers $m$ (note that we need not assume that $m$ is an integer here—it may very well be polynomial-valued in some indeterminate $n$, for example). If the "simpler" right-hand-side generating function, $n ≥ 0$, is a rational function of $m$, then the form of this sequence suggests that the sequence is eventually periodic modulo fixed particular cases of integer-valued $a_{n} ≡ b_{n} (mod m)$. For example, we can prove that the Euler numbers, $$\langle E_n \rangle = \langle 1, 1, 5, 61, 1385, \ldots \rangle \longmapsto \langle 1,1,2,1,2,1,2,\ldots \rangle \pmod{3}\,,$$ satisfy the following congruence modulo 3: $$\sum_{n = 0}^\infty E_n z^n = \frac{1-z^2}{1+z^2} \pmod{3}\,. $$

One useful method of obtaining congruences for sequences enumerated by special generating functions modulo any integers (i.e., not only prime powers $B(z)$) is given in the section on continued fraction representations of (even non-convergent) ordinary generating functions by $x$-fractions above. We cite one particular result related to generating series expanded through a representation by continued fraction from Lando's Lectures on Generating Functions as follows: $z$

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 $m ≥ 2$ which show the versatility of generating functions in tackling problems involving integer sequences.

The Stirling numbers modulo small integers
The main article on the Stirling numbers generated by the finite products $$S_n(x) := \sum_{k=0}^n \begin{bmatrix} n \\ k \end{bmatrix} x^k = x(x+1)(x+2) \cdots (x+n-1)\,,\quad n \geq 1\,, $$

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

$$S_n(x) = [x(x+1)] \cdot [x(x+1)] \cdots = x^{\left\lceil \frac{n}{2} \right\rceil} (x+1)^{\left\lfloor \frac{n}{2} \right\rfloor}\,, $$

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

$$\begin{bmatrix} n \\ k \end{bmatrix} \equiv \binom{\left\lfloor \frac{n}{2} \right\rfloor}{k - \left\lceil \frac{n}{2} \right\rceil} \pmod{2}\,, $$

and consequently shows that $p^{k}$ is even whenever $A(z)$.

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 $$\begin{align} \begin{bmatrix} n \\ m \end{bmatrix} & \equiv [x^m] \left( x^{\left\lceil \frac{n}{3} \right\rceil} (x+1)^{\left\lceil \frac{n-1}{3} \right\rceil} (x+2)^{\left\lfloor \frac{n}{3} \right\rfloor} \right) && \pmod{3} \\ & \equiv \sum_{k=0}^{m} \begin{pmatrix} \left\lceil \frac{n-1}{3} \right\rceil \\ k \end{pmatrix} \begin{pmatrix} \left\lfloor \frac{n}{3} \right\rfloor \\ m-k - \left\lceil \frac{n}{3} \right\rceil \end{pmatrix} \times 2^{\left\lceil \frac{n}{3} \right\rceil + \left\lfloor \frac{n}{3} \right\rfloor -(m-k)} && \pmod{3}\,. \end{align}$$

Congruences for the partition function
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 $A_{p}(z)$ is generated by the reciprocal infinite $J$-Pochhammer symbol product (or $$-Pochhammer product as the case may be) given by $$\begin{align} \sum_{n = 0}^\infty p(n) z^n & = \frac{1}{\left(1-z\right)\left(1-z^2\right)\left(1-z^3\right) \cdots} \\[4pt] & = 1 + z + 2z^2 + 3 z^3 + 5z^4 + 7z^5 + 11z^6 + \cdots. \end{align}$$

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: $$\begin{align} p(5m+4) & \equiv 0 \pmod{5} \\ p(7m+5) & \equiv 0 \pmod{7} \\ p(11m+6) & \equiv 0 \pmod{11} \\ p(25m+24) & \equiv 0 \pmod{5^2}\,. \end{align}$$

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 $$\frac{1}{(1-z)^5} = \sum_{i=0}^\infty \binom{4+i}{4}z^i\,,$$ all of the coefficients are divisible by 5 except for those which correspond to the powers $a_{n} = [z^{n}] A_{p}(z)$ and moreover in those cases the remainder of the coefficient is 1 modulo 5. Thus, $$\frac{1}{(1-z)^5} \equiv \frac{1}{1-z^5} \pmod{5}\,,$$ or equivalently $$ \frac{1-z^5}{(1-z)^5} \equiv 1 \pmod{5}\,.$$ It follows that $$\frac{\left(1-z^5\right)\left(1-z^{10}\right)\left(1-z^{15}\right) \cdots }{\left((1-z)\left(1-z^2\right)\left(1-z^3\right) \cdots \right)^5} \equiv 1 \pmod{5}\,. $$

Using the infinite product expansions of $$z \cdot \frac{\left(1-z^5\right)\left(1-z^{10}\right) \cdots }{\left(1-z\right)\left(1-z^2\right) \cdots } = z \cdot \left((1-z)\left(1-z^2\right) \cdots \right)^4 \times \frac{\left(1-z^5\right)\left(1-z^{10}\right) \cdots }{\left(\left(1-z\right)\left(1-z^2\right) \cdots \right)^5}\,,$$ it can be shown that the coefficient of $0 ≤ n < 2p$ in $A_{p}(z)$ is divisible by 5 for all $q$. Finally, since $$\begin{align} \sum_{n = 1}^\infty p(n-1) z^n & = \frac{z}{(1-z)\left(1-z^2\right) \cdots} \\[6px] & = z \cdot \frac{\left(1-z^5\right)\left(1-z^{10}\right) \cdots }{(1-z)\left(1-z^2\right) \cdots } \times \left(1+z^5+z^{10}+\cdots\right)\left(1+z^{10}+z^{20}+\cdots\right) \cdots \end{align}$$ we may equate the coefficients of $p ≥ 2$ in the previous equations to prove our desired congruence result, namely that $p | p_{1}, p_{1}p_{2}, p_{1}p_{2}p_{3}$ for all $p | p_{1}p_{2}⋯p_{k}$.

Transformations of generating functions
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

$$s_n := \sum_{m=0}^n \binom{n}{m} C_{n,m} a_m, $$

in the form of $k ≥ 1$ involving the original sequence generating function. For example, if the sums are $$s_n := \sum_{k = 0}^\infty \binom{n+k}{m+2k} a_k \,$$ then the generating function for the modified sum expressions is given by $$S(z) = \frac{z^m}{(1-z)^{m+1}} A\left(\frac{z}{(1-z)^2}\right)$$ (see also the binomial transform and the Stirling transform).

There are also integral formulas for converting between a sequence's OGF, $p_{1}p_{2}⋯p_{k}$, and its exponential generating function, or EGF, $A(z) ≡ A_{k}(z) (mod p)$, and vice versa given by

$$\begin{align} F(z) &= \int_0^\infty \hat{F}(tz) e^{-t} \, dt \,, \\[4px] \hat{F}(z) &= \frac{1}{2\pi} \int_{-\pi}^\pi F\left(z e^{-i\vartheta}\right) e^{e^{i\vartheta}} \, d\vartheta \,, \end{align}$$

provided that these integrals converge for appropriate values of $z$.

Other applications
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
Examples of polynomial sequences generated by more complex generating functions include:


 * Appell polynomials
 * Chebyshev polynomials
 * Difference polynomials
 * Generalized Appell polynomials
 * $m$-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

Convolution polynomials
Knuth's article titled "Convolution Polynomials" defines a generalized class of convolution polynomial sequences by their special generating functions of the form $$F(z)^x = \exp\bigl(x \log F(z)\bigr) = \sum_{n = 0}^\infty f_n(x) z^n,$$ for some analytic function $z$ with a power series expansion such that $p(n)$.

We say that a family of polynomials, $[n k]$, forms a convolution family if $k < ⌊ n⁄2 ⌋$ and if the following convolution condition holds for all $q$, $F$ and for all $p(n)$: $$f_n(x+y) = f_n(x) f_0(y) + f_{n-1}(x) f_1(y) + \cdots + f_1(x) f_{n-1}(y) + f_0(x) f_n(y). $$

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:

$$\begin{align} f_n(x+y) & = \sum_{k=0}^n f_k(x) f_{n-k}(y) \\ f_n(2x) & = \sum_{k=0}^n f_k(x) f_{n-k}(x) \\ xn f_n(x+y) & = (x+y) \sum_{k=0}^n k f_k(x) f_{n-k}(y) \\ \frac{(x+y) f_n(x+y+tn)}{x+y+tn} & = \sum_{k=0}^n \frac{x f_k(x+tk)}{x+tk} \frac{y f_{n-k}(y+t(n-k))}{y+t(n-k)}. \end{align}$$
 * The sequence $1, z^{5}, z^{10}, ...$ is of binomial type
 * Special values of the sequence include $z^{5m + 5}$ and $z · ((1 − z)(1 − z^{2})⋯)^{4}$, and
 * For arbitrary (fixed) $$x, y, t \isin \mathbb{C}$$, these polynomials satisfy convolution formulas of the form

For a fixed non-zero parameter $$t \isin \mathbb{C}$$, we have modified generating functions for these convolution polynomial sequences given by $$\frac{z F_n(x+tn)}{(x+tn)} = \left[z^n\right] \mathcal{F}_t(z)^x, $$ where $z^{5m + 5}$ is implicitly defined by a functional equation of the form $p(5m + 4) ≡ 0 (mod 5)$. Moreover, we can use matrix methods (as in the reference) to prove that given two convolution polynomial sequences, $m ≥ 0$ and $S(z) = g(z) A(f(z))$, with respective corresponding generating functions, $F(z)$ and $F̂(z)$, then for arbitrary $x$ we have the identity $$\left[z^n\right] \left(G(z) F\left(z G(z)^t\right)\right)^x = \sum_{k=0}^n F_k(x) G_{n-k}(x+tk). $$

Examples of convolution polynomial sequences include the binomial power series, $F(0) = 1$, so-termed tree polynomials, the Bell numbers, $f_{0}, f_{1}, f_{2}, ...$, the Laguerre polynomials, and the Stirling convolution polynomials.

Tables of special generating functions
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.


 * {| class="wikitable"

! Formal power series !! Generating-function formula !! Notes
 * $$\sum_{n = 0}^\infty \binom{m+n}{n} \left(H_{n+m}-H_m\right) z^n$$ || $$\frac{1}{(1-z)^{m+1}} \ln \frac{1}{1-z}$$ || $$H_n$$ is a first-order harmonic number
 * $$\sum_{n = 0}^\infty B_n \frac{z^n}{n!}$$ || $$\frac{z}{e^z-1}$$ || $$B_n$$ is a Bernoulli number
 * $$\sum_{n = 0}^\infty F_{mn} z^n$$ || $$\frac{F_m z}{1-(F_{m-1}+F_{m+1})z+(-1)^m z^2}$$ || $$F_n$$ is a Fibonacci number and $$m \in \mathbb{Z}^{+}$$
 * $$\sum_{n = 0}^\infty \left\{\begin{matrix} n \\ m \end{matrix} \right\} z^n$$ || $$(z^{-1})^{\overline{-m}} = \frac{z^m}{(1-z)(1-2z)\cdots(1-mz)}$$ || $$x^{\overline{n}}$$ denotes the rising factorial, or Pochhammer symbol and some integer $$m \geq 0$$
 * $$\sum_{n = 0}^\infty \left[\begin{matrix} n \\ m \end{matrix} \right] z^n$$ || $$z^{\overline{m}} = z(z+1) \cdots (z+m-1)$$
 * $$\sum_{n = 1}^\infty \frac{(-1)^{n-1}4^n (4^n-2) B_{2n} z^{2n}}{(2n) \cdot (2n)!}$$ || $$\ln \frac{\tan(z)}{z}$$
 * $$\sum_{n = 0}^\infty \frac{(1/2)^{\overline{n}} z^{2n}}{(2n+1) \cdot n!}$$ || $$z^{-1} \arcsin(z)$$
 * $$\sum_{n = 0}^\infty H_n^{(s)} z^n$$ || $$\frac{\operatorname{Li}_s(z)}{1-z}$$ || $$\operatorname{Li}_s(z)$$ is the polylogarithm function and $$H_n^{(s)}$$ is a generalized harmonic number for $$\Re(s) > 1$$
 * $$\sum_{n = 0}^\infty n^m z^n$$ || $$\sum_{0 \leq j \leq m} \left\{\begin{matrix} m \\ j \end{matrix} \right\} \frac{j! \cdot z^j}{(1-z)^{j+1}}$$ || $$\left\{\begin{matrix} n \\ m \end{matrix} \right\}$$ is a Stirling number of the second kind and where the individual terms in the expansion satisfy $$\frac{z^i}{(1-z)^{i+1}} = \sum_{k=0}^{i} \binom{i}{k} \frac{(-1)^{k-i}}{(1-z)^{k+1}}$$
 * $$\sum_{k < n} \binom{n-k}{k} \frac{n}{n-k} z^k$$ || $$\left(\frac{1+\sqrt{1+4z}}{2}\right)^n + \left(\frac{1-\sqrt{1+4z}}{2}\right)^n$$ ||
 * $$\sum_{n_1, \ldots, n_m \geq 0} \min(n_1, \ldots, n_m) z_1^{n_1} \cdots z_m^{n_m}$$ || $$\frac{z_1 \cdots z_m}{(1-z_1) \cdots (1-z_m) (1-z_1 \cdots z_m)}$$ || The two-variable case is given by $$M(w, z) := \sum_{m,n \geq 0} \min(m, n) w^m z^n = \frac{wz}{(1-w)(1-z)(1-wz)}$$
 * $$\sum_{n = 0}^\infty \binom{s}{n} z^n$$ || $$(1+z)^s$$ || $$s \in \mathbb{C}$$
 * $$\sum_{n = 0}^\infty \binom{n}{k} z^n$$ || $$\frac{z^k}{(1-z)^{k+1}}$$ || $$k \in \mathbb{N}$$
 * $$\sum_{n = 1}^\infty \log{(n)} z^n$$||$$\left.-\frac{\partial}{\partial s}\operatorname{{Li}_s(z)}\right|_{s=0}$$||
 * }
 * $$\sum_{n = 0}^\infty H_n^{(s)} z^n$$ || $$\frac{\operatorname{Li}_s(z)}{1-z}$$ || $$\operatorname{Li}_s(z)$$ is the polylogarithm function and $$H_n^{(s)}$$ is a generalized harmonic number for $$\Re(s) > 1$$
 * $$\sum_{n = 0}^\infty n^m z^n$$ || $$\sum_{0 \leq j \leq m} \left\{\begin{matrix} m \\ j \end{matrix} \right\} \frac{j! \cdot z^j}{(1-z)^{j+1}}$$ || $$\left\{\begin{matrix} n \\ m \end{matrix} \right\}$$ is a Stirling number of the second kind and where the individual terms in the expansion satisfy $$\frac{z^i}{(1-z)^{i+1}} = \sum_{k=0}^{i} \binom{i}{k} \frac{(-1)^{k-i}}{(1-z)^{k+1}}$$
 * $$\sum_{k < n} \binom{n-k}{k} \frac{n}{n-k} z^k$$ || $$\left(\frac{1+\sqrt{1+4z}}{2}\right)^n + \left(\frac{1-\sqrt{1+4z}}{2}\right)^n$$ ||
 * $$\sum_{n_1, \ldots, n_m \geq 0} \min(n_1, \ldots, n_m) z_1^{n_1} \cdots z_m^{n_m}$$ || $$\frac{z_1 \cdots z_m}{(1-z_1) \cdots (1-z_m) (1-z_1 \cdots z_m)}$$ || The two-variable case is given by $$M(w, z) := \sum_{m,n \geq 0} \min(m, n) w^m z^n = \frac{wz}{(1-w)(1-z)(1-wz)}$$
 * $$\sum_{n = 0}^\infty \binom{s}{n} z^n$$ || $$(1+z)^s$$ || $$s \in \mathbb{C}$$
 * $$\sum_{n = 0}^\infty \binom{n}{k} z^n$$ || $$\frac{z^k}{(1-z)^{k+1}}$$ || $$k \in \mathbb{N}$$
 * $$\sum_{n = 1}^\infty \log{(n)} z^n$$||$$\left.-\frac{\partial}{\partial s}\operatorname{{Li}_s(z)}\right|_{s=0}$$||
 * }
 * $$\sum_{n = 0}^\infty \binom{s}{n} z^n$$ || $$(1+z)^s$$ || $$s \in \mathbb{C}$$
 * $$\sum_{n = 0}^\infty \binom{n}{k} z^n$$ || $$\frac{z^k}{(1-z)^{k+1}}$$ || $$k \in \mathbb{N}$$
 * $$\sum_{n = 1}^\infty \log{(n)} z^n$$||$$\left.-\frac{\partial}{\partial s}\operatorname{{Li}_s(z)}\right|_{s=0}$$||
 * }
 * $$\sum_{n = 1}^\infty \log{(n)} z^n$$||$$\left.-\frac{\partial}{\partial s}\operatorname{{Li}_s(z)}\right|_{s=0}$$||
 * }

History
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."