gives the holonomic sequence , specified by the linear difference equation lde[h,k].


represents a pure holonomic sequence .


  • Mathematical sequence, suitable for both symbolic and numerical manipulation; also known as holonomic sequence and P-recursive sequence.
  • The holonomic sequence defined by a DifferenceRoot function satisfies a holonomic difference equation with polynomial coefficients and initial values .
  • DifferenceRoot can be used like any other mathematical function.
  • FunctionExpand will attempt to convert DifferenceRoot functions in terms of special functions.
  • The sequences representable by DifferenceRoot include a large number of special sequences.
  • DifferenceRootReduce can convert many special sequences to DifferenceRoot sequences.
  • Holonomic sequences are closed under many operations, including:
  • constant multiple, integer power
    sums and products
    discrete convolution
    discrete shift, difference and sum
  • DifferenceRoot is automatically generated by functions such as Sum, RSolve, and SeriesCoefficient.
  • Functions such as Sum, DifferenceDelta, and GeneratingFunction work with DifferenceRoot inputs.
  • DifferenceRoot automatically threads over lists.


open allclose all

Basic Examples  (3)

Reduce combinations of special sequences to their DifferenceRoot form:

Use f like any sequence:

Define a new sequence using DifferenceRoot directly:

Use it like any sequence:

Prove properties:

Several functions can produce closed-form answers by using DifferenceRoot functions:

Scope  (10)

Evaluate at an arbitrary point:

DifferenceRoot threads element-wise over lists:

DifferenceRoot works on rational coefficients:

Homogeneous linear recurrences:

Inhomogeneous linear recurrences:

Multiple initial values:

Solutions of a difference equation:

A result from Sum:

Coefficients in the expansion of a function:

Formula of a sequence:

Generalizations & Extensions  (2)

Equations with holonomic constant terms are automatically lifted to polynomial coefficients:

The following function is not defined for n>0:

Add the initial value y[1]=2 so that it is defined for all n:

Applications  (1)

Define Pell numbers:

Closed form formula:

Identity analogous to Cassini's identity:

A summation identity:

Properties & Relations  (4)

Use DifferenceRootReduce to generate DifferenceRoot objects:

Get the corresponding ordinary difference equation:

Use the equation to verify solutions:

Sum of a DifferenceRoot object:

Find the generating function of a DifferenceRoot object:

Find the exponential generating function of a DifferenceRoot object:

Introduced in 2008