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
- If
u1(n),u2(n),... are sequences solutions oflistrec[1],listrec[2],...,poltorecoutputs a linear recurrence equation verified byP(n,u1(n),...). - The option
homogeneous=truerequests a homogeneous recurrence (the default isfalse). Affine constants are represented by an invariant auxiliary state during the direct dependence computation. The existing optioncomputeinicontinues to control initial conditions. - With
operator=name, output initial conditions are not constructed. The supplied name is used verbatim; homogeneous output is an operator polynomial and inhomogeneous output has the formL(name)=-q. Input data is still used when available to restore singular-index factors lost during elimination before the operator is returned.
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));
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));
See Also
gfun, gfun[parameters], gfun[rec+rec], gfun[rec*rec], gfun[poltodiffeq]