gfun[poltorec] - determine recurrence satisfied by a polynomial in holonomic sequences

Calling Sequence

poltorec(P, listrec, list_unknowns, u(n), <computeini=bool>, <homogeneous=bool>, <operator=name>)

Parameters

P - polynomial in z and the (possibly shifted) variables in list_unknowns

listrec - list containing, for each of the variables in list_unknowns, either a linear recurrence equation or a set containing the equation together with initial conditions

list_unknowns - list of the unknowns [u1(n), u2(n),...], in the same order as in listrec

u,n - the name of the holonomic sequence and the generic variable

homogeneous - (optional) boolean requesting a homogeneous output recurrence; the default is false

operator - (optional) name used verbatim as the shift operator

Description

Examples

> with(gfun):
rec1:={u1(n+1)=(n+1)*u1(n),u1(0)=1}:
rec2:={u2(n+2)=2*u2(n+1)-3*n*u2(n),u2(1)=1,u2(0)=1}:
poltorec(u1(n)^2+2*u1(n)*u2(n),[rec1,rec2],[u1(n),u2(n)],u(n));
\[\{\left(-3 n^{7}-39 n^{6}-192 n^{5}-462 n^{4}-579 n^{3}-363 n^{2}-90 n \right) u \! \left(n \right)+\left(5 n^{5}+54 n^{4}+209 n^{3}+354 n^{2}+254 n +60\right) u \! \left(n +1\right)+\left(-n^{4}-12 n^{3}-46 n^{2}-62 n -15\right) u \! \left(n +2\right)+\left(n^{2}+4 n \right) u \! \left(n +3\right), u \! \left(0\right) = 3, u \! \left(1\right) = 3, u \! \left(2\right) = 12, u \! \left(3\right) = 48\}\]

Cassini's identity:

> fib:={F(n+2)=F(n+1)+F(n),F(0)=1,F(1)=1}:
poltorec(F(n+2)*F(n)-F(n+1)^2,[fib],[F(n)],f(n));
\[\{f \! \left(n +1\right)+f \! \left(n \right), f \! \left(0\right) = 1\}\]

See Also

gfun, gfun[parameters], gfun[rec+rec], gfun[rec*rec], gfun[poltodiffeq]