---
title: "ExponentialGeneratingFunction"
language: "en"
type: "Symbol"
summary: "ExponentialGeneratingFunction[expr, n, x] gives the exponential generating function in x for the sequence whose n\\[Null]^th term is given by the expression expr. ExponentialGeneratingFunction[expr, {n1, n2, ...}, {x1, x2, ...}] gives the multidimensional exponential generating function in x1, x2, ... whose n1, n2, ... term is given by expr."
keywords: 
- exponential generating function
- EGF
canonical_url: "https://reference.wolfram.com/language/ref/ExponentialGeneratingFunction.html"
source: "Wolfram Language Documentation"
related_guides: 
  - 
    title: "Integer Sequences"
    link: "https://reference.wolfram.com/language/guide/IntegerSequences.en.md"
  - 
    title: "Summation Transforms"
    link: "https://reference.wolfram.com/language/guide/SummationTransforms.en.md"
related_functions: 
  - 
    title: "GeneratingFunction"
    link: "https://reference.wolfram.com/language/ref/GeneratingFunction.en.md"
  - 
    title: "D"
    link: "https://reference.wolfram.com/language/ref/D.en.md"
  - 
    title: "Series"
    link: "https://reference.wolfram.com/language/ref/Series.en.md"
  - 
    title: "SeriesCoefficient"
    link: "https://reference.wolfram.com/language/ref/SeriesCoefficient.en.md"
  - 
    title: "Sum"
    link: "https://reference.wolfram.com/language/ref/Sum.en.md"
  - 
    title: "ZTransform"
    link: "https://reference.wolfram.com/language/ref/ZTransform.en.md"
  - 
    title: "RSolve"
    link: "https://reference.wolfram.com/language/ref/RSolve.en.md"
---
# ExponentialGeneratingFunction

ExponentialGeneratingFunction[expr, n, x] gives the exponential generating function in x for the sequence whose n$$^{\text{th}}$$ term is given by the expression expr.

ExponentialGeneratingFunction[expr, {n1, n2, …}, {x1, x2, …}] gives the multidimensional exponential generating function in x1, x2, … whose n1, n2, … term is given by expr.

## Details and Options

* The exponential generating function for a sequence whose $n$$$^{\text{th}}$$ term is $a_n$ is given by $\sum _{n=0}^{\infty } a_n \left.x^n\right/n!$.

* The multidimensional exponential generating function is given by $\sum _{n_1=0}^{\infty } \sum _{n_2=0}^{\infty } \cdots  a_{n_1n_2}\cdots  x_1^{n_1}/n_1! x_2^{n_2}/n_2! \cdots$.

* The following options can be given:

|                     |               |                                                                   |
| ------------------- | ------------- | ----------------------------------------------------------------- |
| Assumptions         | \$Assumptions | assumptions to make about parameters                              |
| GenerateConditions  | False         | whether to generate answers that involve conditions on parameters |
| Method              | Automatic     | method to use                                                     |
| VerifyConvergence   | True          | whether to verify convergence                                     |

---

## Examples (31)

### Basic Examples (1)

The exponential generating function for the sequence whose ``n``$$^{\text{th}}$$ term is 1:

```wl
In[1]:= ExponentialGeneratingFunction[1, n, x]

Out[1]= E^x
```

The $n$$$^{\text{th}}$$ term in the series is $1/n!$ :

```wl
In[2]:= Series[%, {x, 0, 10}]

Out[2]=
SeriesData[Notebook$$26`x, 0, {1, 1, Rational[1, 2], Rational[1, 6], Rational[1, 24], 
  Rational[1, 120], Rational[1, 720], Rational[1, 5040], Rational[1, 40320], Rational[1, 362880], 
  Rational[1, 3628800]}, 0, 11, 1]
```

### Scope (19)

#### Basic Uses (6)

Exponential generating function of a univariate sequence:

```wl
In[1]:= ExponentialGeneratingFunction[a ^ n, n, z]

Out[1]= E^a z
```

Exponential generating function of a multivariate sequence:

```wl
In[2]:= ExponentialGeneratingFunction[a ^ (n + m), {n, m}, {z, w}]

Out[2]= E^a (w + z)
```

---

Compute a typical exponential generating function:

```wl
In[1]:= F = ExponentialGeneratingFunction[n (n + 1)(-1 / 2) ^ n, n, z]

Out[1]= (1/4) E^-z / 2 (-4 + z) z
```

Plot the magnitude using ``Plot3D``, ``ContourPlot`` or ``DensityPlot``:

```wl
In[2]:= Block[{z = u + I v}, Table[plot[Abs[F], {u, -2, 2}, {v, -2, 2}], {plot, {Plot3D, ContourPlot, DensityPlot}}]]

Out[2]= {[image], [image], [image]}
```

Plot the complex phase:

```wl
In[3]:= Block[{z = u + I v}, Table[plot[Arg[F], {u, -2, 2}, {v, -2, 2}], {plot, {Plot3D, ContourPlot, DensityPlot}}]]

Out[3]= [image]
```

---

Generate conditions for the region of convergence:

```wl
In[1]:= ExponentialGeneratingFunction[a * n!, n, z, GenerateConditions -> True]

Out[1]= ConditionalExpression[a/(1 - z), Abs[z] < 1]
```

Plot the region for $a=\frac{1}{2}$:

```wl
In[2]:= With[{z = u + I v}, RegionPlot[Abs[z] < 1, {u, -2, 2}, {v, -2, 2}]]

Out[2]= [image]
```

---

Evaluate the exponential generating function at a point:

```wl
In[1]:= F = ExponentialGeneratingFunction[Sin[n 2Pi / 3](2 / 3) ^ n, n, Exp[I ω]]

Out[1]= (1/3) (E^(2/3) E^(2 I π/3) + I ω ((1/2) Sqrt[3] E^-(2 I π/3) - (1/2) Sqrt[3] E^(2 I π/3)) + E^(2/3) E^-(2 I π/3) + I ω (-(1/2) Sqrt[3] E^-(2 I π/3) + (1/2) Sqrt[3] E^(2 I π/3)))
```

Plot the spectrum:

```wl
In[2]:= LogPlot[Abs[F] ^ 2, {ω, 0, 2π}, Ticks -> {{0, π, 2π}, Automatic}]

Out[2]= [image]
```

The phase:

```wl
In[3]:= Plot[Arg[F], {ω, 0, 2π}, Ticks -> {{0, π, 2π}, Automatic}]

Out[3]= [image]
```

Plot both the spectrum and the plot phase using color:

```wl
In[4]:= LogPlot[Abs[F] ^ 2, {ω, 0, 2π}, Ticks -> {{0, π, 2π}, Automatic}, ColorFunction -> Function[ω, Evaluate@Hue[Arg[F] / (2Pi) + 1 / 2]], ColorFunctionScaling -> False, Filling -> Axis]

Out[4]= [image]
```

Plot the spectrum in the complex plane using ``ParametricPlot3D`` :

```wl
In[5]:= ParametricPlot3D[{Cos[ω], Sin[ω], Log[10, Abs[F] ^ 2]}, {ω, 0, 2π}, BoxRatios -> {1, 1, 1}]

Out[5]= [image]
```

---

``ExponentialGeneratingFunction`` will use several properties including linearity:

```wl
In[1]:= ExponentialGeneratingFunction[a f[n] + b g[n], n, z]

Out[1]= a ExponentialGeneratingFunction[f[n], n, z] + b ExponentialGeneratingFunction[g[n], n, z]
```

Multiplication by exponentials:

```wl
In[2]:= {ExponentialGeneratingFunction[a ^ n f[n], n, z], ExponentialGeneratingFunction[b ^ (-n)f[n], n, z]}

Out[2]= {ExponentialGeneratingFunction[f[n], n, a z], ExponentialGeneratingFunction[f[n], n, (z/b)]}

In[3]:= ExponentialGeneratingFunction[Exp[I ω n]f[n], n, z]

Out[3]= ExponentialGeneratingFunction[f[n], n, E^I ω z]
```

Multiplication by polynomials:

```wl
In[4]:= {ExponentialGeneratingFunction[ n f[n], n, z], ExponentialGeneratingFunction[n(n + 1) f[n], n, z]}

Out[4]= {z ExponentialGeneratingFunction[f[1 + n], n, z], 2 z ExponentialGeneratingFunction[f[1 + n], n, z] + z^2 ExponentialGeneratingFunction[f[2 + n], n, z]}
```

Conjugate:

```wl
In[5]:= ExponentialGeneratingFunction[Conjugate[f[n]], n, z]

Out[5]= Conjugate[ExponentialGeneratingFunction[f[n], n, Conjugate[z]]]
```

---

``ExponentialGeneratingFunction`` automatically threads over lists:

```wl
In[1]:= ExponentialGeneratingFunction[{a ^ n, b ^ n}, n, z]

Out[1]= {E^a z, E^b z}

In[2]:= ExponentialGeneratingFunction[{{a ^ n, b ^ n}, {n, n ^ 2}}, n, z]

Out[2]= {{E^a z, E^b z}, {E^z z, E^z z (1 + z)}}
```

Equations:

```wl
In[3]:= ExponentialGeneratingFunction[a ^ n == f[n], n, z]

Out[3]= E^a z == ExponentialGeneratingFunction[f[n], n, z]
```

Rules:

```wl
In[4]:= ExponentialGeneratingFunction[f[n] -> a ^ n, n, z]

Out[4]= ExponentialGeneratingFunction[f[n], n, z] -> E^a z
```

#### Special Sequences (13)

Discrete unit steps:

```wl
In[1]:= {ExponentialGeneratingFunction[UnitStep[n], n, z], ExponentialGeneratingFunction[UnitStep[n - 3], n, z]}

Out[1]= {E^z, (1/2) (-2 + 2 E^z - 2 z - z^2)}

In[2]:= Table[DiscretePlot[f, {n, -10, 10}], {f, {UnitStep[n], UnitStep[n - 3]}}]

Out[2]= {[image], [image]}
```

Discrete ramps:

```wl
In[3]:= {ExponentialGeneratingFunction[n UnitStep[n], n, z], ExponentialGeneratingFunction[(n - 3)UnitStep[n - 3], n, z]}

Out[3]= {E^z z, (1/2) (6 - 6 E^z + 4 z + 2 E^z z + z^2)}

In[4]:= Table[DiscretePlot[f, {n, -10, 10}], {f, {n UnitStep[n], (n - 3)UnitStep[n - 3]}}]

Out[4]= {[image], [image]}
```

---

Polynomials:

```wl
In[1]:= {ExponentialGeneratingFunction[n, n, z], ExponentialGeneratingFunction[n ^ 2, n, z]}

Out[1]= {E^z z, E^z z (1 + z)}
```

Factorial polynomials:

```wl
In[2]:= ExponentialGeneratingFunction[Pochhammer[n, Range[0, 3]], n, z]

Out[2]= {E^z, E^z z, E^z z (2 + z), E^z z (6 + 6 z + z^2)}

In[3]:= ExponentialGeneratingFunction[FactorialPower[n, Range[0, 3]], n, z]

Out[3]= {E^z, E^z z, E^z z^2, E^z z^3}
```

---

Exponential functions:

```wl
In[1]:= ExponentialGeneratingFunction[a ^ n, n, z]

Out[1]= E^a z

In[2]:= ExponentialGeneratingFunction[a ^ n UnitStep[n - 2], n, x]

Out[2]= -1 + E^a x - a x
```

Exponential polynomials:

```wl
In[3]:= {ExponentialGeneratingFunction[n a ^ n, n, z], ExponentialGeneratingFunction[n ^ 2 a ^ n, n, z]}

Out[3]= {a E^a z z, a E^a z z (1 + a z)}

In[4]:= Table[DiscretePlot[f, {n, 0, 40}], {f, {n (10 / 12) ^ n, n ^ 2 (10 / 12) ^ n}}]

Out[4]= {[image], [image]}
```

Factorial exponential polynomials:

```wl
In[5]:= ExponentialGeneratingFunction[Pochhammer[n, Range[0, 3]] a ^ n, n, z]

Out[5]= {E^a z, a E^a z z, a E^a z z (2 + a z), a E^a z z (6 + 6 a z + a^2 z^2)}

In[6]:= ExponentialGeneratingFunction[FactorialPower[n, Range[0, 3]] a ^ n, n, z]

Out[6]= {E^a z, a E^a z z, a^2 E^a z z^2, a^3 E^a z z^3}
```

---

Trigonometric functions:

```wl
In[1]:= {ExponentialGeneratingFunction[Sin[ω n + ϕ], n, z], ExponentialGeneratingFunction[Cos[ω n + ϕ], n, z]}

Out[1]= {E^z Cos[ω] Sin[ϕ + z Sin[ω]], E^z Cos[ω] Cos[ϕ + z Sin[ω]]}

In[2]:= Table[DiscretePlot[f, {n, -20, 20}], {f, {Sin[2π / 10 n], Cos[2π / 10 n]}}]

Out[2]= {[image], [image]}
```

Trigonometric, exponential and polynomial:

```wl
In[3]:= {ExponentialGeneratingFunction[(5 / 6) ^ n Sin[ω n], n, z], ExponentialGeneratingFunction[n (5 / 6) ^ n Sin[ω n], n, z]}

Out[3]= {Sin[(5/6) z Sin[ω]] (Cosh[(5/6) z Cos[ω]] + Sinh[(5/6) z Cos[ω]]), (5/6) E^(5/6) z Cos[ω] z (Cos[(5/6) z Sin[ω]] Sin[ω] + Cos[ω] Sin[(5/6) z Sin[ω]])}

In[4]:= Table[DiscretePlot[f, {n, 0, 20}], {f, {(5 / 6) ^ n Sin[2π / 10 n], n (5 / 6) ^ n Sin[2π / 10 n]}}]

Out[4]= {[image], [image]}
```

---

Combinations of the previous input:

```wl
In[1]:= ExponentialGeneratingFunction[n ^ 2 a ^ n + b ^ n Sin[ω n] UnitStep[n - 2], n, z]

Out[1]= a E^a z z (1 + a z) + (1/2) I E^-I ω (E^b E^-I ω z + I ω - E^b E^I ω z + I ω - b z + b E^2 I ω z)

In[2]:= DiscretePlot[n ^ 2 (5 / 6) ^ n  + (11 / 12) ^ n 20Sin[2Pi / 10 n]UnitStep[n - 2], {n, 0, 50}]

Out[2]= [image]
```

---

Different ways of expressing piecewise-defined signals:

```wl
In[1]:= ExponentialGeneratingFunction[n (UnitStep[n] - UnitStep[n - 6]) + a ^ n UnitStep[n - 6], n, z]

Out[1]= (1/24) z (24 + 24 z + 12 z^2 + 4 z^3 + z^4) + (1/120) (-120 + 120 E^a z - 120 a z - 60 a^2 z^2 - 20 a^3 z^3 - 5 a^4 z^4 - a^5 z^5)

In[2]:= ExponentialGeneratingFunction[Piecewise[{{n, n ≤ 5}, {a ^ n, True}}], n, z]

Out[2]= (1/120) (-120 + 120 E^a z + 120 z - 120 a z + 120 z^2 - 60 a^2 z^2 + 60 z^3 - 20 a^3 z^3 + 20 z^4 - 5 a^4 z^4 + 5 z^5 - a^5 z^5)

In[3]:= Simplify[%% - %]

Out[3]= 0
```

---

Rational functions:

```wl
In[1]:= ExponentialGeneratingFunction[1 / (n + 1), n, z]

Out[1]= -(1 - E^z/z)

In[2]:= ExponentialGeneratingFunction[(n^2 + n + 1) / (n + 1) ^ 2, n, z]

Out[2]= E^z + (1 - E^z/z) + (-EulerGamma - Gamma[0, -z] - Log[-z]/z)

In[3]:= ExponentialGeneratingFunction[FactorialPower[n, -2], n, z]

Out[3]= (-1 + E^z - z/z^2)
```

Rational exponential functions:

```wl
In[4]:= ExponentialGeneratingFunction[a ^ n / (n + 1) ^ 2, n, z]

Out[4]= (-EulerGamma - Gamma[0, -a z] - Log[-a z]/a z)

In[5]:= ExponentialGeneratingFunction[a ^ n FactorialPower[n, -2], n, z]

Out[5]= -(1 - E^a z + a z/a^2 z^2)
```

---

Hypergeometric term sequences:

```wl
In[1]:= ExponentialGeneratingFunction[1 / n!, n, z]

Out[1]= BesselI[0, 2 Sqrt[z]]
```

The ``DiscreteRatio`` is rational for all hypergeometric term sequences:

```wl
In[2]:= DiscreteRatio[1 / n!, n]

Out[2]= (1/1 + n)
```

Many functions give hypergeometric terms:

```wl
In[3]:= hl = {a ^ n, n!, Gamma[n], Pochhammer[a, n], FactorialPower[a, n], Binomial[n, a], Binomial[b, n], CatalanNumber[n]};

In[4]:= DiscreteRatio[hl, n]

Out[4]= {a, 1 + n, n, a + n, a - n, (1 + n/1 - a + n), (b - n/1 + n), (2 (1 + 2 n)/2 + n)}
```

Any products are hypergeometric terms:

```wl
In[5]:= DiscreteRatio[Times@@RandomChoice[hl, 3], n]

Out[5]= ((1 + n) (a + n)^2/1 - a + n)
```

Transforms of hypergeometric terms:

```wl
In[6]:= ExponentialGeneratingFunction[(2^-2 + n/Gamma[(1/2) + n]), n, z]

Out[6]= (Cosh[2 Sqrt[2] Sqrt[z]]/4 Sqrt[π])

In[7]:= ExponentialGeneratingFunction[n / Binomial[2n, n], n, z]

Out[7]= (1/8) Sqrt[z] (2 Sqrt[z] + 2 E^z / 4 Sqrt[π] Erf[(Sqrt[z]/2)] + E^z / 4 Sqrt[π] z Erf[(Sqrt[z]/2)])

In[8]:= ExponentialGeneratingFunction[(FactorialPower[a1, n]/FactorialPower[b1, n]FactorialPower[b2, n]), n, z]

Out[8]= HypergeometricPFQ[{-a1}, {-b1, -b2}, -z]

In[9]:= ExponentialGeneratingFunction[Pochhammer[n, k], n, x]

Out[9]= x Gamma[1 + k] Hypergeometric1F1[1 + k, 2, x]

In[10]:= ExponentialGeneratingFunction[n! / CatalanNumber[n], n, x]

Out[10]= Hypergeometric2F1[1, 2, (1/2), (x/4)]
```

---

Holonomic sequences:

```wl
In[1]:= ExponentialGeneratingFunction[LegendreP[n, a], n, z]

Out[1]= E^a z BesselJ[0, Sqrt[1 - a^2] z]
```

A holonomic sequence is defined by a linear difference equation:

```wl
In[2]:= DifferenceRootReduce[LegendreP[n, a], n]

Out[2]=
DifferenceRoot[Function[{\[FormalY], \[FormalN]}, 
  {(1 + \[FormalN])*\[FormalY][\[FormalN]] + (-3*a - 2*\[FormalN]*a)*\[FormalY][1 + \[FormalN]] + (2 + \[FormalN])*\[FormalY][2 + \[FormalN]] == 0, \[FormalY][-1] == 1, 
   \[FormalY][0] == 1}]][n]
```

Many special function are holonomic sequences in their index:

```wl
In[3]:= ExponentialGeneratingFunction[ChebyshevT[n, x], n, z]

Out[3]= E^x z Cos[Sqrt[1 - x^2] z]

In[4]:= ExponentialGeneratingFunction[ChebyshevU[2n, x] ^ 2, n, z]

Out[4]= (-E^(z/(I x + Sqrt[1 - x^2])^4) + E^(I x + Sqrt[1 - x^2])^4 z (-1 + 8 x^2 - 8 x^4 - 4 I x Sqrt[1 - x^2] + 8 I x^3 Sqrt[1 - x^2]) + E^z (-2 + 4 x (x - I Sqrt[1 - x^2]))) / (4 (-1 + x^2) (I x + Sqrt[1 - x^2])^2)
```

---

``DifferenceRoot`` in general results in ``DifferentialRoot`` functions:

```wl
In[1]:= ExponentialGeneratingFunction[DifferenceRoot[Function[{y, m}, {y[m + 2] == y[m + 1] + y[m], y[0] == 0, y[1] == 1}]][n], n, z]

Out[1]=
DifferentialRoot[Function[{\[FormalY], \[FormalX]}, 
  {-\[FormalY][\[FormalX]] - Derivative[1][\[FormalY]][\[FormalX]] + Derivative[2][\[FormalY]][\[FormalX]] == 0, \[FormalY][0] == 0, 
   Derivative[1][\[FormalY]][0] == 1}]][z]
```

---

Special sequences:

```wl
In[1]:= ExponentialGeneratingFunction[BernoulliB[n], n, x]

Out[1]= (1/2) x (-1 + Coth[(x/2)])

In[2]:= ExponentialGeneratingFunction[EulerE[n], n, x]

Out[2]= Sech[x]

In[3]:= ExponentialGeneratingFunction[Fibonacci[n] / n!, n, z]

Out[3]= (BesselI[0, Sqrt[2 (1 + Sqrt[5])] Sqrt[z]] - BesselJ[0, 2 Sqrt[(2/1 + Sqrt[5])] Sqrt[z]]/Sqrt[5])

In[4]:= ExponentialGeneratingFunction[HarmonicNumber[n] / n!, n, z]

Out[4]= BesselK[0, 2 Sqrt[z]] + BesselI[0, 2 Sqrt[z]] (EulerGamma + (Log[z]/2))
```

---

Periodic sequences:

```wl
In[1]:= ExponentialGeneratingFunction[Mod[n, 3], n, z]

Out[1]= (1/3) (3 E^z + E^E^-(2 I π/3) z (2 E^-(2 I π/3) + E^(2 I π/3)) + E^E^(2 I π/3) z (E^-(2 I π/3) + 2 E^(2 I π/3)))

In[2]:= ExponentialGeneratingFunction[Exp[n 2π I / 3], n, z]

Out[2]= E^E^(2 I π/3) z

In[3]:= ExponentialGeneratingFunction[Mod[n ^ 2, 5] ^ 3, n, x]

Out[3]= (1/5) (130 E^x + E^E^-(4 I π/5) x (64 E^-(2 I π/5) + 64 E^(2 I π/5) + E^-(4 I π/5) + E^(4 I π/5)) + E^E^(4 I π/5) x (64 E^-(2 I π/5) + 64 E^(2 I π/5) + E^-(4 I π/5) + E^(4 I π/5)) + E^E^-(2 I π/5) x (E^-(2 I π/5) + E^(2 I π/5) + 64 E^-(4 I π/5) + 64 E^(4 I π/5)) + E^E^(2 I π/5) x (E^-(2 I π/5) + E^(2 I π/5) + 64 E^-(4 I π/5) + 64 E^(4 I π/5)))
```

---

Multivariate exponential generating functions:

```wl
In[1]:= ExponentialGeneratingFunction[a^n + m, {n, m}, {u, v}]

Out[1]= E^a (u + v)

In[2]:= ExponentialGeneratingFunction[n ^ 2 m ^ 3, {n, m}, {u, v}]

Out[2]= E^u + v (u + u^2) (v + 3 v^2 + v^3)

In[3]:= ExponentialGeneratingFunction[a^n + mn ^ 2 m ^ 3, {n, m}, {u, v}]

Out[3]= a^2 E^a (u + v) u (1 + a u) v (1 + 3 a v + a^2 v^2)

In[4]:= ExponentialGeneratingFunction[Sin[n + m]a ^ n, {n, m}, {u, v}]

Out[4]= -(1/2) I (E^E^I (a u + v) - E^a E^-I u + E^-I v)

In[5]:= ExponentialGeneratingFunction[m / (n + 1), {n, m}, {u, v}]

Out[5]= (E^v (-1 + E^u) v/u)

In[6]:= ExponentialGeneratingFunction[Mod[n + m, 2], {n, m}, {u, v}]

Out[6]= (1/2) E^-u - v (-1 + E^2 (u + v))
```

### Generalizations & Extensions (1)

Compute the exponential generating function at a point:

```wl
In[1]:= ExponentialGeneratingFunction[1, n, 0.5]

Out[1]= 1.64872

In[2]:= ExponentialGeneratingFunction[1, n, 1 / z]

Out[2]= E^(1/z)
```

### Options (5)

#### GenerateConditions (1)

By default, no conditions are given for where a generating function is convergent:

```wl
In[1]:= ExponentialGeneratingFunction[(n + 1)!, n, x]

Out[1]= (1/(1 - x)^2)
```

Use ``GenerateConditions`` to generate conditions of validity:

```wl
In[2]:= ExponentialGeneratingFunction[(n + 1)!, n, x, GenerateConditions -> True]

Out[2]= ConditionalExpression[1/(1 - x)^2, Abs[x] < 1]
```

#### Method (1)

Different methods may produce different formulas:

```wl
In[1]:= ExponentialGeneratingFunction[Fibonacci[n], n, z]

Out[1]= (E^-(2 z/1 + Sqrt[5]) (-1 + E^((5 + Sqrt[5]) z/1 + Sqrt[5]))/Sqrt[5])

In[2]:= ExponentialGeneratingFunction[Fibonacci[n], n, z, Method -> "Holonomic"]

Out[2]=
DifferentialRoot[Function[{\[FormalY], \[FormalX]}, 
  {-\[FormalY][\[FormalX]] - Derivative[1][\[FormalY]][\[FormalX]] + Derivative[2][\[FormalY]][\[FormalX]] == 0, \[FormalY][0] == 0, 
   Derivative[1][\[FormalY]][0] == 1}]][z]
```

#### VerifyConvergence (3)

Setting ``VerifyConvergence`` to ``False`` will treat generating functions as formal objects:

```wl
In[1]:= ExponentialGeneratingFunction[n! 2 ^ n, n, x, VerifyConvergence -> False]

Out[1]= (1/1 - 2 x)
```

---

Setting ``VerifyConvergence`` to ``True`` will verify that the radius of convergence is nonzero:

```wl
In[1]:= ExponentialGeneratingFunction[n ! 2 ^ n, n, x, VerifyConvergence -> True]

Out[1]= (1/1 - 2 x)
```

---

In addition, setting ``GenerateConditions`` to ``True`` will display the conditions for convergence:

```wl
In[1]:= ExponentialGeneratingFunction[n ! 2 ^ n, n, x, VerifyConvergence -> True, GenerateConditions -> True]

Out[1]= ConditionalExpression[1/(1 - 2*x), Abs[x] < 1/2]
```

### Properties & Relations (3)

``ExponentialGeneratingFunction`` effectively computes an infinite sum:

```wl
In[1]:= ExponentialGeneratingFunction[n ^ 2, n, z]

Out[1]= E^z z (1 + z)

In[2]:= Sum[n ^ 2 / n! z ^ n, {n, 0, Infinity}]

Out[2]= E^z (z + z^2)
```

---

Linearity:

```wl
In[1]:= ExponentialGeneratingFunction[a f[n] + b g[n], n, z]

Out[1]= a ExponentialGeneratingFunction[f[n], n, z] + b ExponentialGeneratingFunction[g[n], n, z]
```

---

``ExponentialGeneratingFunction`` is closely related to ``GeneratingFunction``:

```wl
In[1]:= {ExponentialGeneratingFunction[n, n, z], GeneratingFunction[n / n!, n, z]}

Out[1]= {E^z z, E^z z}
```

``ZTransform`` :

```wl
In[2]:= {ExponentialGeneratingFunction[n, n, z], ZTransform[n / n!, n, 1 / z]}

Out[2]= {E^z z, E^z z}
```

``FourierSequenceTransform`` :

```wl
In[3]:= {ExponentialGeneratingFunction[n, n, Exp[-I ω]], FourierSequenceTransform[n UnitStep[n] / n!, n, ω]}

Out[3]= {E^E^-I ω - I ω, E^E^-I ω - I ω}
```

### Possible Issues (1)

A ``ExponentialGeneratingFunction`` may not converge for all values of parameters:

```wl
In[1]:= {Sum[a ^ n * n! * x ^ n / n! /. {a -> 2, x -> 1}, {n, 0, ∞}], ExponentialGeneratingFunction[2 ^ n n!, n, 1]}
```

Sum::div: Sum does not converge.

```wl
Out[1]= {Underoverscript[∑, n = 0, ∞]2^n, -1}

In[2]:= ExponentialGeneratingFunction[a ^ n n!, n, x]

Out[2]= (1/1 - a x)
```

Use ``GenerateConditions`` to get the region of convergence:

```wl
In[3]:= ExponentialGeneratingFunction[n! a ^ n, n, x, GenerateConditions -> True]

Out[3]= ConditionalExpression[1/(1 - a*x), Abs[x] < 1/Abs[a]]
```

### Neat Examples (1)

Create a gallery of exponential generating functions:

```wl
In[1]:= flist = {{UnitStep[n + 1 / 2], n, z}, {n ^ 2 + 2, n, z}, {1 / (2n + 1), n, z}, {Sin[a n], n, z}, {ChebyshevT[n, a], n, z}, {HarmonicNumber[n] / n!, n, z}, {a ^ n Sin[n], n, z}, {Mod[n, 4], n, z}, {Power[m, n], {m, n}, {u, v}}, {m / (n + 1), {m, n}, {u, v}}};

In[2]:= Grid[Prepend[{#[[1]], ExponentialGeneratingFunction@@#}& /@ flist, {f, "Exponential Generating Function"}], IconizedObject[«Grid options»]]//TraditionalForm

Out[2]//TraditionalForm=
$$\begin{array}{cc}
 f & \text{Exponential Generating Function} \\
 \theta \left(n+\frac{1}{2}\right) & e^z \\
 n^2+2 & e^z \left(z^2+z+2\right) \\
 \frac{1}{2 n+1} & \frac{\sqrt{\pi } \text{erfi}\left(\sqrt{z}\right)}{2 \sqrt{z}} \\
 \sin (a n) &  ... \sin (a z \sin (1)) (\sinh (a z \cos (1))+\cosh (a z \cos (1))) \\
 (n \bmod 4) & \frac{1}{4} \left(-2 e^{-z}-(2+2 i) e^{-i z}-(2-2 i) e^{i z}+6 e^z\right) \\
 m^n & e^{u e^v} \\
 \frac{m}{n+1} & \frac{e^u u \left(e^v-1\right)}{v} \\
\end{array}$$
```

## See Also

* [`GeneratingFunction`](https://reference.wolfram.com/language/ref/GeneratingFunction.en.md)
* [`D`](https://reference.wolfram.com/language/ref/D.en.md)
* [`Series`](https://reference.wolfram.com/language/ref/Series.en.md)
* [`SeriesCoefficient`](https://reference.wolfram.com/language/ref/SeriesCoefficient.en.md)
* [`Sum`](https://reference.wolfram.com/language/ref/Sum.en.md)
* [`ZTransform`](https://reference.wolfram.com/language/ref/ZTransform.en.md)
* [`RSolve`](https://reference.wolfram.com/language/ref/RSolve.en.md)

## Related Guides

* [Integer Sequences](https://reference.wolfram.com/language/guide/IntegerSequences.en.md)
* [Summation Transforms](https://reference.wolfram.com/language/guide/SummationTransforms.en.md)

## History

* [Introduced in 2008 (7.0)](https://reference.wolfram.com/language/guide/SummaryOfNewFeaturesIn70.en.md)