DifferenceRootReduce
Reduces a hypergeometric-type sequence to its holonomic (P-recursive) representation — , a linear recurrence with polynomial(n) coefficients plus enough initial values to pin the sequence down, applied straight back to . Covers Factorial, , CatalanNumber, Binomial(n, k) for concrete k, polynomials in n, Fibonacci, LucasL, HarmonicNumber, and a sum of two hypergeometric terms; declines everything else, leaving the call symbolic. Provided by @enumeratio/analytic.
✓ checked against that system · ! checked, with disagreements (hover a chip)Wolfram Language
DifferenceRootReduce✓DifferenceRootReduce(f(n), n)the P-recursive reduction of , as .Typed signatures
| Type | Package | Applies |
|---|---|---|
(expression, symbol) -> expression | analytic | always |
Details
- Order 1 (a single recurrence step, one or two initial conditions): Factorial(n), , CatalanNumber(n), polynomials in n, and Binomial(n, k) for k a concrete non-negative integer — plus products and quotients of these. Binomial's recurrence has a genuine pole at (its own ratio divides by ), so it carries two anchors, at and , straddling it — confirmed against a local wolframscript, which makes the identical choice.
- Order 2, constant coefficients: Fibonacci(n) and LucasL(n), with or .
- HarmonicNumber(n) reduces to order 1 with a constant inhomogeneous term, — Wolfram's own reduction, not the order-2 homogeneous form the standard difference identity for would otherwise suggest; probed rather than guessed.
- Sum of two hypergeometric terms (order 1 each) reduces to order ≤ 2 via the classical cross-product elimination (Petkovšek's sum rule): below.
- Every reduction is checked by running its own recurrence forward (exact rational arithmetic, DifferenceRoot) against the original expression at ~20 integer points before being trusted; see difference-root.ts.
- Declines (returns the call unevaluated) a polynomial or product/quotient the internal ratio decomposition doesn't recognize, a symbolic or negative Binomial order, three or more summands, and anything outside the heads listed above.
Examples
4 more kept as data, checked against the oraclesAbout
| Examples | 13 |
|---|---|
| Checked against | Wolfram Language 11 agree1 unevaluated |
| Crosswalk | Wolfram Language |
See also: DifferenceRoot, DifferentialRootReduce, Fibonacci, LucasL, HarmonicNumber, Binomial