Limits of Sequences

Provides methods to compute limit of terms having sequences at infinity.

sympy.series.limitseq.difference_delta(expr, n=None, step=1)[source]

Difference Operator.

Explanation

Discrete analog of differential operator. Given a sequence x[n], returns the sequence x[n + step] - x[n].

Examples

>>> from sympy import difference_delta as dd
>>> from sympy.abc import n
>>> dd(n*(n + 1), n)
2*n + 2
>>> dd(n*(n + 1), n, 2)
4*n + 6

References

sympy.series.limitseq.dominant(expr, n)[source]

Finds the dominant term in a sum, that is a term that dominates every other term.

Explanation

If limit(a/b, n, oo) is oo then a dominates b. If limit(a/b, n, oo) is 0 then b dominates a. Otherwise, a and b are comparable.

If there is no unique dominant term, then returns None.

Examples

>>> from sympy import Sum
>>> from sympy.series.limitseq import dominant
>>> from sympy.abc import n, k
>>> dominant(5*n**3 + 4*n**2 + n + 1, n)
5*n**3
>>> dominant(2**n + Sum(k, (k, 0, n)), n)
2**n
sympy.series.limitseq.limit_seq(expr, n=None, trials=5)[source]

Finds the limit of a sequence as index n tends to infinity.

Parameters:

expr : Expr

SymPy expression for the n-th term of the sequence

n : Symbol, optional

The index of the sequence, an integer that tends to positive infinity. If None, inferred from the expression unless it has multiple symbols.

trials: int, optional

The algorithm is highly recursive. trials is a safeguard from infinite recursion in case the limit is not easily computed by the algorithm. Try increasing trials if the algorithm returns None.

Admissible Terms

The algorithm is designed for sequences built from rational functions, indefinite sums, and indefinite products over an indeterminate n. Terms of alternating sign are also allowed, but more complex oscillatory behavior is not supported.

Examples

>>> from sympy import limit_seq, Sum, binomial
>>> from sympy.abc import n, k, m
>>> limit_seq((5*n**3 + 3*n**2 + 4) / (3*n**3 + 4*n - 5), n)
5/3
>>> limit_seq(binomial(2*n, n) / Sum(binomial(2*k, k), (k, 1, n)), n)
3/4
>>> limit_seq(Sum(k**2 * Sum(2**m/m, (m, 1, k)), (k, 1, n)) / (2**n*n), n)
4

References

[R842]

Computing Limits of Sequences - Manuel Kauers