Products
  • Wolfram|One

    The definitive Wolfram Language and notebook experience

  • Mathematica

    The original technical computing environment

  • System Modeler

    Multidomain modeling and simulation of complex systems

  • Compute ServicesUse with Mathematica and Wolfram|One
  • AI AccessUse with Mathematica and Wolfram|One
  • Finance Platform
  • Wolfram|Alpha Notebook Edition
  • Application Server
  • Enterprise Private Cloud
  • Wolfram Engine
  • Wolfram Player
  • Wolfram Cloud App
  • Wolfram Player App

More mobile apps

Wolfram|Alpha

  • Wolfram|Alpha Website
  • Wolfram|Alpha APIs

AI Products

  • Wolfram AI Ecosystem
  • Wolfram Foundation Tool
  • Wolfram Cloud MCP
  • Wolfram Local MCP
  • Agent One API
  • CAG Component APIs

Core Technologies of Wolfram Products

  • Wolfram Language
  • Computable Data
  • Wolfram Notebooks
  • Linguistic Understanding

Additional Deployment Options

  • Wolfram Cloud
  • Wolfram Web Engine
  • wolframscript
  • WSTPServer
  • Group & Organizational Licensing
  • All Products
Consulting & Solutions

We deliver solutions for the AI era—combining symbolic computation, data-driven insights and deep technical expertise

Wolfram Consulting

Data Science, Finance & Business

  • Artificial Intelligence
  • Data Science
  • Healthcare
  • Real Estate

Engineering

  • Civil Engineering
  • Automotive Engineering
  • Sustainable Energy

Science & Technology

  • AgTech
  • Biosciences
  • Environmental Science
  • Food Science
  • Quantum Computation
  • Social and Behavioral Sciences

More Wolfram Solutions

Technology for Education

  • Research Universities
  • Colleges & Teaching Universities
  • High Schools
  • Resources for Students

Education Initiatives

  • Next-Gen EdTech
  • Computer-Based Math

More Solutions for Education

  • Contact Us
Learning & Support

Get Started

  • Wolfram Language Introduction
  • Fast Intro for Programmers
  • Fast Intro for Math Students
  • Wolfram Language Documentation

More Learning

  • Highlighted Core Areas
  • Demonstrations
  • YouTube
  • Daily Study Groups
  • Wolfram Schools and Programs
  • Books

Grow Your Skills

  • Wolfram U

    Courses in computing, science, life and more

  • Community

    Learn, solve problems and share ideas.

  • Blog

    News, views and insights from Wolfram

  • Resources for

    Software Developers

Tech Support

  • Contact Us
  • Support FAQs
  • Support FAQs
  • Contact Us
Company
  • About Wolfram
  • Career Center
  • All Sites & Resources
  • Connect & Follow
  • Contact Us

Work with Us

  • Student Ambassador Initiative
  • Wolfram for Startups
  • Student Opportunities
  • Jobs Using Wolfram Language

Educational Programs for Adults

  • Summer School
  • Winter School

Educational Programs for Youth

  • Middle School Camp
  • High School Research Program
  • Computational Adventures

Read

  • Stephen Wolfram's Writings
  • Wolfram Blog
  • Wolfram Tech | Books
  • Wolfram Media
  • Complex Systems

Educational Resources

  • Wolfram MathWorld
  • Wolfram in STEM
  • Wolfram Challenges
  • Wolfram Problem Generator

Wolfram Initiatives

  • Wolfram Science
  • Wolfram Foundation
  • History of Mathematics Project

Events

  • Stephen Wolfram Livestreams
  • Online & In-Person Events
  • Contact Us
  • Connect & Follow
For AIs
  • Your Account
  • User Portal
  • Wolfram Cloud
  • Products
    • Wolfram|One
    • Mathematica
    • System Modeler
    • Compute ServicesUse with Mathematica and Wolfram|One
    • AI AccessUse with Mathematica and Wolfram|One
    • Finance Platform
    • Wolfram|Alpha Notebook Edition
    • Application Server
    • Enterprise Private Cloud
    • Wolfram Engine
    • Wolfram Player
    • Wolfram Cloud App
    • Wolfram Player App

    More mobile apps

    • Wolfram|Alpha
      • Wolfram|Alpha Website
      • Wolfram|Alpha APIs
    • AI Products
      • Wolfram AI Ecosystem
      • Wolfram Foundation Tool
      • Wolfram Cloud MCP
      • Wolfram Local MCP
      • Agent One API
      • CAG Component APIs
    • Core Technologies
      • Wolfram Language
      • Computable Data
      • Wolfram Notebooks
      • Linguistic Understanding
    • Additional Deployment Options
      • Wolfram Cloud
      • Wolfram Web Engine
      • wolframscript
      • WSTPServer
    • Group & Organizational Licensing
    • All Products
  • Consulting & Solutions
    • Wolfram Consulting

    Data Science, Finance & Business

    • Artificial Intelligence
    • Data Science
    • Healthcare
    • Real Estate

    Engineering

    • Civil Engineering
    • Automotive Engineering
    • Sustainable Energy

    Science & Technology

    • AgTech
    • Biosciences
    • Environmental Science
    • Food Science
    • Quantum Computation
    • Social and Behavioral Sciences

    More Wolfram Solutions

    Technology for Education

    • Research Universities
    • Colleges & Teaching Universities
    • High Schools
    • Resources for Students

    Education Initiatives

    • Next-Gen EdTech
    • Computer-Based Math

    More Solutions for Education

    • Contact Us
  • Learning & Support

    Get Started

    • Wolfram Language Introduction
    • Fast Intro for Programmers
    • Fast Intro for Math Students
    • Wolfram Language Documentation

    Grow Your Skills

    • Wolfram U

      Courses in computing, science, life and more

    • Community

      Learn, solve problems and share ideas.

    • Blog

      News, views and insights from Wolfram

    • Resources for

      Software Developers
    • Tech Support
      • Contact Us
      • Support FAQs
    • More Learning
      • Highlighted Core Areas
      • Demonstrations
      • YouTube
      • Daily Study Groups
      • Wolfram Schools and Programs
      • Books
    • Support FAQs
    • Contact Us
  • Company
    • About Wolfram
    • Career Center
    • All Sites & Resources
    • Connect & Follow
    • Contact Us

    Work with Us

    • Student Ambassador Initiative
    • Wolfram for Startups
    • Student Opportunities
    • Jobs Using Wolfram Language

    Educational Programs for Adults

    • Summer School
    • Winter School

    Educational Programs for Youth

    • Middle School Camp
    • High School Research Program
    • Computational Adventures

    Read

    • Stephen Wolfram's Writings
    • Wolfram Blog
    • Wolfram Tech | Books
    • Wolfram Media
    • Complex Systems
    • Educational Resources
      • Wolfram MathWorld
      • Wolfram in STEM
      • Wolfram Challenges
      • Wolfram Problem Generator
    • Wolfram Initiatives
      • Wolfram Science
      • Wolfram Foundation
      • History of Mathematics Project
    • Events
      • Stephen Wolfram Livestreams
      • Online & In-Person Events
    • Contact Us
    • Connect & Follow
  • For AIs
  • Wolfram Cloud
  • Your Account
  • User Portal
Wolfram Language & System Documentation Center
GeneratingFunction
  • See Also
    • Series
    • SeriesCoefficient
    • Sum
    • ZTransform
    • BilateralZTransform
    • DiscreteConvolve
    • RSolve
    • ExponentialGeneratingFunction
    • FindGeneratingFunction
    • AsymptoticSum
    • AsymptoticRSolveValue
  • Related Guides
    • Summation Transforms
    • Integer Sequences
    • Discrete Mathematics
    • Discrete Calculus
    • Integral Transforms
    • Recurrence and Sum Functions
    • See Also
      • Series
      • SeriesCoefficient
      • Sum
      • ZTransform
      • BilateralZTransform
      • DiscreteConvolve
      • RSolve
      • ExponentialGeneratingFunction
      • FindGeneratingFunction
      • AsymptoticSum
      • AsymptoticRSolveValue
    • Related Guides
      • Summation Transforms
      • Integer Sequences
      • Discrete Mathematics
      • Discrete Calculus
      • Integral Transforms
      • Recurrence and Sum Functions

GeneratingFunction[expr,n,x]

gives the generating function in x for the sequence whose n^(th) series coefficient is given by the expression expr.

GeneratingFunction[expr,{n1,…,nm},{x1,…,xm}]

gives the multidimensional generating function in x1,…,xm whose n1,… ,nm coefficient is given by expr.

Details and Options
Details and Options Details and Options
Examples  
Basic Examples  
Scope  
Basic Uses  
Special Sequences  
Special Operators  
Generalizations & Extensions  
Options  
Assumptions  
GenerateConditions  
Method  
VerifyConvergence  
Properties & Relations  
Possible Issues  
Neat Examples  
See Also
Related Guides
Related Links
History
Cite this Page
BUILT-IN SYMBOL
  • See Also
    • Series
    • SeriesCoefficient
    • Sum
    • ZTransform
    • BilateralZTransform
    • DiscreteConvolve
    • RSolve
    • ExponentialGeneratingFunction
    • FindGeneratingFunction
    • AsymptoticSum
    • AsymptoticRSolveValue
  • Related Guides
    • Summation Transforms
    • Integer Sequences
    • Discrete Mathematics
    • Discrete Calculus
    • Integral Transforms
    • Recurrence and Sum Functions
    • See Also
      • Series
      • SeriesCoefficient
      • Sum
      • ZTransform
      • BilateralZTransform
      • DiscreteConvolve
      • RSolve
      • ExponentialGeneratingFunction
      • FindGeneratingFunction
      • AsymptoticSum
      • AsymptoticRSolveValue
    • Related Guides
      • Summation Transforms
      • Integer Sequences
      • Discrete Mathematics
      • Discrete Calculus
      • Integral Transforms
      • Recurrence and Sum Functions

GeneratingFunction

GeneratingFunction[expr,n,x]

gives the generating function in x for the sequence whose n^(th) series coefficient is given by the expression expr.

GeneratingFunction[expr,{n1,…,nm},{x1,…,xm}]

gives the multidimensional generating function in x1,…,xm whose n1,… ,nm coefficient is given by expr.

Details and Options

  • The generating function for a sequence whose n^(th) term is an is given by .
  • The multidimensional generating function is given by .
  • The following options can be given:
  • Assumptions $Assumptionsassumptions to make about parameters
    GenerateConditions Falsewhether to generate answers that involve conditions on parameters
    Method Automaticmethod to use
    VerifyConvergence Truewhether to verify convergence
  • In TraditionalForm, GeneratingFunction is output using G.

Examples

open all close all

Basic Examples  (3)

The generating function for the sequence whose n^(th) term is 1:

Wolfram Language code: GeneratingFunction[1, n, x]

All coefficients in the series are 1:

Wolfram Language code: Series[%, {x, 0, 10}]

Univariate generating function:

Wolfram Language code: GeneratingFunction[(1/n!^2), n, x]

Multivariate:

Wolfram Language code: GeneratingFunction[(1/(n + 1)! m!), {n, m}, {x, y}]

The generating function for a shifted sequence:

Wolfram Language code: GeneratingFunction[f[n + 1], n, x]

Scope  (23)

Basic Uses  (7)

Generating function of a univariate function:

Wolfram Language code: GeneratingFunction[a ^ n, n, z]

Generating function of a multivariate function:

Wolfram Language code: GeneratingFunction[1 / (m!n!), {m, n}, {x, y}]

Compute a typical generating function:

Wolfram Language code: F = GeneratingFunction[n (n + 1)(-1 / 2) ^ n, n, z]

Plot the magnitude using Plot3D, ContourPlot or DensityPlot:

Wolfram Language code: Block[{z = u + I v}, Table[plot[Abs[F], {u, -2, 2}, {v, -2, 2}], {plot, {Plot3D, ContourPlot, DensityPlot}}]]

Plot the complex phase:

Wolfram Language code: Block[{z = u + I v}, Table[plot[Arg[F], {u, -2, 2}, {v, -2, 2}], {plot, {Plot3D, ContourPlot, DensityPlot}}]]

Generate conditions for the region of convergence:

Wolfram Language code: GeneratingFunction[a ^ n, n, z, GenerateConditions -> True]

Plot the region for :

Wolfram Language code: With[{z = u + I v}, RegionPlot[Abs[z] < 1 / Abs[1 / 2], {u, -4, 4}, {v, -4, 4}]]

Evaluate the generating function at a point:

Wolfram Language code: F = GeneratingFunction[Sin[n 2Pi / 3](2 / 3) ^ n, n, Exp[I ω]]

Plot the spectrum:

Wolfram Language code: LogPlot[Abs[F] ^ 2, {ω, 0, 2π}, Ticks -> {{0, π, 2π}, Automatic}]

The phase:

Wolfram Language code: Plot[Arg[F], {ω, 0, 2π}, Ticks -> {{0, π, 2π}, Automatic}]

Plot both the spectrum and the plot phase using color:

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

Plot the spectrum in the complex plane using ParametricPlot3D:

Wolfram Language code: ParametricPlot3D[{Cos[ω], Sin[ω], Log[10, Abs[F] ^ 2]}, {ω, 0, 2π}, BoxRatios -> {1, 1, 1}]

GeneratingFunction will use several properties including linearity:

Wolfram Language code: GeneratingFunction[a f[n] + b g[n], n, z]

Shifts:

Wolfram Language code: {GeneratingFunction[f[n + 1], n, z], GeneratingFunction[f[n - 1], n, z]}

Multiplication by exponentials:

Wolfram Language code: {GeneratingFunction[a ^ n f[n], n, z], GeneratingFunction[b ^ (-n)f[n], n, z]}
Wolfram Language code: GeneratingFunction[Exp[I ω n]f[n], n, z]

Multiplication by polynomials:

Wolfram Language code: {GeneratingFunction[ n f[n], n, z], GeneratingFunction[n(n + 1) f[n], n, z]}

Conjugate:

Wolfram Language code: GeneratingFunction[Conjugate[f[n]], n, z]

GeneratingFunction automatically threads over lists:

Wolfram Language code: GeneratingFunction[{a ^ n, b ^ n}, n, z]
Wolfram Language code: GeneratingFunction[{{a ^ n, b ^ n}, {n, n ^ 2}}, n, z]

Equations:

Wolfram Language code: GeneratingFunction[a ^ n == f[n], n, z]

Rules:

Wolfram Language code: GeneratingFunction[f[n] -> a ^ n, n, z]

TraditionalForm typesetting:

Wolfram Language code: GeneratingFunction[f[n], n, z]//TraditionalForm

Special Sequences  (12)

Discrete impulses:

Wolfram Language code: {GeneratingFunction[DiscreteDelta[n], n, z], GeneratingFunction[DiscreteDelta[n - 5], n, z]}
Wolfram Language code: Table[DiscretePlot[f, {n, -10, 10}, PlotStyle -> PointSize[Medium]], {f, {DiscreteDelta[n], DiscreteDelta[n - 5]}}]

Discrete unit steps:

Wolfram Language code: {GeneratingFunction[UnitStep[n], n, z], GeneratingFunction[UnitStep[n - 3], n, z]}
Wolfram Language code: Table[DiscretePlot[f, {n, -10, 10}], {f, {UnitStep[n], UnitStep[n - 3]}}]

Discrete ramps:

Wolfram Language code: {GeneratingFunction[n UnitStep[n], n, z], GeneratingFunction[(n - 3)UnitStep[n - 3], n, z]}
Wolfram Language code: Table[DiscretePlot[f, {n, -10, 10}], {f, {n UnitStep[n], (n - 3)UnitStep[n - 3]}}]

Polynomials result in rational generating functions:

Wolfram Language code: {GeneratingFunction[n, n, z], GeneratingFunction[n ^ 2, n, z]}

Factorial polynomials:

Wolfram Language code: GeneratingFunction[Pochhammer[n, Range[0, 3]], n, z]
Wolfram Language code: GeneratingFunction[FactorialPower[n, Range[0, 3]], n, z]

Exponential functions:

Wolfram Language code: GeneratingFunction[a ^ n, n, z]

Exponential polynomials:

Wolfram Language code: {GeneratingFunction[n a ^ n, n, z], GeneratingFunction[n ^ 2 a ^ n, n, z]}
Wolfram Language code: Table[DiscretePlot[f, {n, 0, 40}], {f, {n (10 / 12) ^ n, n ^ 2 (10 / 12) ^ n}}]

Factorial exponential polynomials:

Wolfram Language code: GeneratingFunction[Pochhammer[n, Range[0, 3]] a ^ n, n, z]
Wolfram Language code: GeneratingFunction[FactorialPower[n, Range[0, 3]] a ^ n, n, z]

Trigonometric functions:

Wolfram Language code: {GeneratingFunction[Sin[ω n + ϕ], n, z], GeneratingFunction[Cos[ω n + ϕ], n, z]}
Wolfram Language code: Table[DiscretePlot[f, {n, -20, 20}], {f, {Sin[2π / 10 n], Cos[2π / 10 n]}}]

Trigonometric, exponential and polynomial:

Wolfram Language code: {GeneratingFunction[(5 / 6) ^ n Sin[ω n], n, z], GeneratingFunction[n (5 / 6) ^ n Sin[ω n], n, z]}
Wolfram Language code: Table[DiscretePlot[f, {n, 0, 20}], {f, {(5 / 6) ^ n Sin[2π / 10 n], n (5 / 6) ^ n Sin[2π / 10 n]}}]

Combinations of the previous input will also generate rational generating functions:

Wolfram Language code: GeneratingFunction[n ^ 2 a ^ n + b ^ n Sin[ω n] UnitStep[n + 20], n, z]
Wolfram Language code: DiscretePlot[n ^ 2 (5 / 6) ^ n + (11 / 12) ^ n 20Sin[2Pi / 10 n]UnitStep[n - 20], {n, 0, 50}]

Different ways of expressing piecewise-defined signals:

Wolfram Language code: GeneratingFunction[n (UnitStep[n] - UnitStep[n - 6]) + a ^ n UnitStep[n - 6], n, z]
Wolfram Language code: GeneratingFunction[Piecewise[{{n, n ≤ 5}, {a ^ n, True}}], n, z]
Wolfram Language code: Simplify[%% - %]

Rational functions:

Wolfram Language code: GeneratingFunction[1 / (n + 1), n, z]
Wolfram Language code: GeneratingFunction[(n^2 + n + 1) / (n + 1) ^ 2, n, z]
Wolfram Language code: GeneratingFunction[FactorialPower[n, -2], n, z]

Rational exponential functions:

Wolfram Language code: GeneratingFunction[a ^ n / (n + 1) ^ 2, n, z]
Wolfram Language code: GeneratingFunction[a ^ n FactorialPower[n, -2], n, z]

Hypergeometric term sequences:

Wolfram Language code: GeneratingFunction[1 / n!, n, z]

The DiscreteRatio is rational for all hypergeometric term sequences:

Wolfram Language code: DiscreteRatio[1 / n!, n]

Many functions give hypergeometric terms:

Wolfram Language code: hl = {a ^ n, n!, Gamma[n], Pochhammer[a, n], FactorialPower[a, n], Binomial[n, a], Binomial[b, n], CatalanNumber[n]};
Wolfram Language code: DiscreteRatio[hl, n]

Any products are hypergeometric terms:

Wolfram Language code: DiscreteRatio[Times@@RandomChoice[hl, 3], n]

Generating functions of hypergeometric terms:

Wolfram Language code: GeneratingFunction[(2^-2 + n/Gamma[(1/2) + n]), n, z]
Wolfram Language code: GeneratingFunction[n / Binomial[2n, n], n, z]
Wolfram Language code: GeneratingFunction[CatalanNumber[n] / Binomial[2n, n], n, z]
Wolfram Language code: GeneratingFunction[(FactorialPower[a1, n]/FactorialPower[b1, n]FactorialPower[b2, n]), n, z]

Holonomic sequences:

Wolfram Language code: GeneratingFunction[LegendreP[n, a], n, z]

A holonomic sequence is defined by a linear difference equation:

Wolfram Language code: DifferenceRootReduce[LegendreP[n, a], n]

Many special function are holonomic sequences in their index:

Wolfram Language code: GeneratingFunction[ChebyshevT[n, x], n, z]
Wolfram Language code: GeneratingFunction[ChebyshevU[2n, x] ^ 2, n, z]

Special sequences:

Wolfram Language code: GeneratingFunction[BernoulliB[n] / n!, n, z]
Wolfram Language code: GeneratingFunction[EulerE[n] / n!, n, z]
Wolfram Language code: GeneratingFunction[DifferenceRoot[Function[{y, m}, {y[m + 2] == y[m + 1] + y[m], y[0] == 0, y[1] == 1}]][n], n, z]

Periodic sequences:

Wolfram Language code: GeneratingFunction[Mod[n, 3], n, z]
Wolfram Language code: GeneratingFunction[Exp[n 2π I / 9], n, z]

Multivariate generating functions:

Wolfram Language code: GeneratingFunction[a^n + m, {n, m}, {u, v}]
Wolfram Language code: GeneratingFunction[n ^ 2 m ^ 3, {n, m}, {u, v}]
Wolfram Language code: GeneratingFunction[Sin[n + m]a ^ n, {n, m}, {u, v}]
Wolfram Language code: GeneratingFunction[m / (n + 1), {n, m}, {u, v}]
Wolfram Language code: GeneratingFunction[Mod[n + m, 3], {n, m}, {u, v}]

Special Operators  (4)

Linearity:

Wolfram Language code: GeneratingFunction[a * f[n] + b * f[n], n, z]

Differences and shifts:

Wolfram Language code: GeneratingFunction[DifferenceDelta[f[n], n], n, z]
Wolfram Language code: GeneratingFunction[DiscreteShift[f[n], n], n, z]

Sums:

Wolfram Language code: GeneratingFunction[Sum[f[m], {m, 0, n}], n, z]
Wolfram Language code: GeneratingFunction[Sum[f[m], {m, a, n}], n, z, Assumptions -> a > 0 && a∈Integers]

Integrals:

Wolfram Language code: GeneratingFunction[Integrate[f[x, n], {x, a, b}], n, z]

Generalizations & Extensions  (1)

Compute the generating function at a point:

Wolfram Language code: GeneratingFunction[1 / n!, n, 0.5]
Wolfram Language code: GeneratingFunction[1 / n!, n, 1 / z]

Options  (6)

Assumptions  (1)

In general, this generating function cannot be given:

Wolfram Language code: GeneratingFunction[f[n + a], n, x]

By providing additional Assumptions, a closed form can be given:

Wolfram Language code: GeneratingFunction[f[n + a], n, x, Assumptions -> a∈Integers && a > 0]

GenerateConditions  (1)

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

Wolfram Language code: GeneratingFunction[a ^ n, n, x]

Use GenerateConditions to generate conditions of validity:

Wolfram Language code: GeneratingFunction[a ^ n, n, x, GenerateConditions -> True]

Method  (1)

Different methods may produce different results:

Wolfram Language code: GeneratingFunction[n, n, z]
Wolfram Language code: GeneratingFunction[n, n, z, Method -> "Holonomic"]

VerifyConvergence  (3)

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

Wolfram Language code: GeneratingFunction[2 ^ n, n, x, VerifyConvergence -> False]

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

Wolfram Language code: GeneratingFunction[2 ^ n, n, x, VerifyConvergence -> True]

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

Wolfram Language code: GeneratingFunction[2 ^ n, n, x, VerifyConvergence -> True, GenerateConditions -> True]

Properties & Relations  (5)

Use SeriesCoefficient to get the sequence from its generating function:

Wolfram Language code: GeneratingFunction[SeriesCoefficient[F[z], {z, 0, n}], n, z]
Wolfram Language code: GeneratingFunction[a ^ n Sin[n], n, z]
Wolfram Language code: SeriesCoefficient[%, {z, 0, n}]

GeneratingFunction effectively computes an infinite sum:

Wolfram Language code: GeneratingFunction[n ^ 2, n, z]
Wolfram Language code: Sum[n ^ 2 z ^ n, {n, 0, Infinity}]

GeneratingFunction and ZTransform can be expressed in terms of each other:

Wolfram Language code: {ZTransform[n ^ 2, n, z], GeneratingFunction[n ^ 2, n, 1 / z]}//Simplify
Wolfram Language code: {ZTransform[n ^ 2, n, 1 / z], GeneratingFunction[n ^ 2, n, z]}//Simplify

Linearity:

Wolfram Language code: GeneratingFunction[a f[n] + b g[n], n, z]

Shifting:

Wolfram Language code: GeneratingFunction[f[n + 2], n, z]

Convolution:

Wolfram Language code: GeneratingFunction[Sum[f[k]g[k - n], {k, 0, n}], n, z]

Derivative:

Wolfram Language code: GeneratingFunction[n f[n], n, z]

GeneratingFunction is closely related to ExponentialGeneratingFunction:

Wolfram Language code: {GeneratingFunction[n / n!, n, z], ExponentialGeneratingFunction[n, n, z]}

ZTransform:

Wolfram Language code: {GeneratingFunction[n, n, z], ZTransform[n, n, 1 / z]}//Simplify

FourierSequenceTransform:

Wolfram Language code: {GeneratingFunction[n, n, Exp[I * ω]], FourierSequenceTransform[n UnitStep[n], n, ω]}

Possible Issues  (1)

A GeneratingFunction may not converge for all values of parameters:

Wolfram Language code: {Sum[2 ^ n 1 ^ n, {n, 0, ∞}], GeneratingFunction[2 ^ n, n, 1]}
Wolfram Language code: GeneratingFunction[a ^ n, n, x]

Use GenerateConditions to get the region of convergence:

Wolfram Language code: GeneratingFunction[a ^ n, n, x, GenerateConditions -> True]

Neat Examples  (1)

Create a gallery of generating functions:

Wolfram Language code: flist = {{UnitStep[n + 1 / 2], n, z}, {n ^ 2 + 2, n, z}, {1 / (2n + 1), n, z}, {Sin[a n], n, z}, {ChebyshevU[n, a], n, z}, {BernoulliB[n] / n!, n, z}, {a ^ n Sin[n], n, z}, {Mod[n, 7], n, z}, {Binomial[m, n], {m, n}, {u, v}}, {m / (n + 1), {m, n}, {u, v}}};
Wolfram Language code: Grid[Prepend[{#[[1]], GeneratingFunction@@#}& /@ flist, {f, "Generating Function"}], IconizedObject[«Grid options»]]//TraditionalForm

See Also

Series  SeriesCoefficient  Sum  ZTransform  BilateralZTransform  DiscreteConvolve  RSolve  ExponentialGeneratingFunction  FindGeneratingFunction  AsymptoticSum  AsymptoticRSolveValue

Function Repository: PoincarePolynomial

Related Guides

    ▪
  • Summation Transforms
  • ▪
  • Integer Sequences
  • ▪
  • Discrete Mathematics
  • ▪
  • Discrete Calculus
  • ▪
  • Integral Transforms
  • ▪
  • Recurrence and Sum Functions

Related Links

  • MathWorld

History

Introduced in 2008 (7.0)

Wolfram Research (2008), GeneratingFunction, Wolfram Language function, https://reference.wolfram.com/language/ref/GeneratingFunction.html.

Text

Wolfram Research (2008), GeneratingFunction, Wolfram Language function, https://reference.wolfram.com/language/ref/GeneratingFunction.html.

CMS

Wolfram Language. 2008. "GeneratingFunction." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/GeneratingFunction.html.

APA

Wolfram Language. (2008). GeneratingFunction. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/GeneratingFunction.html

BibTeX

@misc{reference.wolfram_2026_generatingfunction, author="Wolfram Research", title="{GeneratingFunction}", year="2008", howpublished="\url{https://reference.wolfram.com/language/ref/GeneratingFunction.html}", note=[Accessed: 01-September-2026]}

BibLaTeX

@online{reference.wolfram_2026_generatingfunction, organization={Wolfram Research}, title={GeneratingFunction}, year={2008}, url={https://reference.wolfram.com/language/ref/GeneratingFunction.html}, note=[Accessed: 01-September-2026]}

Top
Introduction for Programmers
Introductory Book
Wolfram Function Repository | Wolfram Data Repository | Wolfram Data Drop | Wolfram Language Products
Top
  • Products
  • Wolfram|One
  • Mathematica
  • AI Access
  • Compute Services
  • System Modeler

  • Wolfram|Alpha Notebook Edition
  • Wolfram|Alpha Pro
  • Mobile Apps

  • Wolfram Engine
  • Wolfram Player

  • Volume & Site Licensing
  • Server Deployment Options
  • Consulting
  • Wolfram Consulting
  • Repositories
  • Data Repository
  • Function Repository
  • Community Paclet Repository
  • Neural Net Repository
  • Prompt Repository

  • Wolfram Language Example Repository
  • Notebook Archive
  • Wolfram GitHub
  • Learning
  • Wolfram U
  • Wolfram Language Documentation
  • Webinars & Training
  • Educational Programs

  • Wolfram Language Introduction
  • Fast Introduction for Programmers
  • Fast Introduction for Math Students
  • Books

  • Wolfram Community
  • Wolfram Blog
  • Public Resources
  • Wolfram|Alpha
  • Wolfram Problem Generator
  • Wolfram Challenges

  • Computer-Based Math
  • Computational Thinking
  • Computational Adventures

  • Demonstrations Project
  • Wolfram Data Drop
  • MathWorld
  • Wolfram Science
  • Wolfram Media Publishing
  • Customer Resources
  • Store
  • Product Downloads
  • User Portal
  • Your Account
  • Organization Access

  • Support FAQ
  • Contact Support
  • Company
  • About Wolfram
  • Careers
  • Contact
  • Events
Wolfram Community Wolfram Blog
Legal & Privacy Policy
WolframAlpha.com | WolframCloud.com
© 2026 Wolfram
© 2026 Wolfram | Legal & Privacy Policy |
English