gfun[nth_term] - compute one term of the solution of a recurrence relation

NumGfun[fnth_term] - compute a floating-point approximation to one term of the solution of a recurrence relation, with guaranteed precision

Calling Sequences

nth_term(rec, u(n), k, [series])

fnth_term(rec, u(n), k, [precision], [series])

Parameters

rec - linear recurrence relation with coefficients in Q[n]

u - name; holonomic sequence name

n - name; variable of the holonomic sequence u

k - nonnegative integer; index

precision - (optional) positive integer; number of digits (of absolute precision)

Description

Examples

> with(gfun): with(NumGfun):
> nth_term({(n^2+1)*u(n+2)+u(n+1)=(2*n+2*I+5)*u(n), u(0)=1, u(1)=0}, u(n), 20);
\[\frac{569008109867936731210287799}{8922539920387740732999062500000}+\frac{860326427452337891464669037 \,\mathrm{I}}{4461269960193870366499531250000}\]
> nth_term(u(n+2)=u(n)+u(n+1), u(n), 50);
\[7778742049 u \! \left(0\right)+12586269025 u \! \left(1\right)\]
> nth_term(u(n+1)=u(n)/(n+1), u(n), 40, 'series');
\[\frac{2772359610018469067133291773316444867218087189 u \! \left(0\right)}{1019894104059872167932014086995144867840000000}\]
> fnth_term(u(n+1)=u(n)/(n+1), u(n), 30, 30, 'series');
\[ 2.718281828459045235360287471353 u \! \left(0\right)\]

See Also

gfun, NumGfun, rectoproc, evaldiffeq