gfun[`rec+rec`] - termwise sum of two holonomic recurrences
gfun[`rec*rec`] - termwise product of two holonomic recurrences
gfun[cauchyproduct] - Cauchy product of two holonomic recurrences
Calling Sequence
`rec+rec`(rec1, rec2, u(n), <homogeneous=bool>, <operator=name>)
`rec*rec`(rec1, rec2, u(n), <homogeneous=bool>, <operator=name>)
cauchyproduct(rec1, rec2, u(n), <homogeneous=bool>, <operator=name>)
Parameters
rec1, rec2 - two linear recurrences with polynomial coefficients
u, n - variable and index of the recurrence
homogeneous - (optional) boolean requesting a homogeneous output recurrence; the default is false
operator - (optional) name used verbatim as the recurrence operator
Description
- If
a(n)andb(n)are the sequences defined respectively byrec1andrec2,gfun[`rec+rec`]outputs a recurrence fora(n)+b(n),gfun[`rec*rec`]outputs a recurrence fora(n)*b(n), andgfun[cauchyproduct]outputs a recurrence for their Cauchy product or convolutionc(n) = sum(a(i)*b(n-i),i=0..n). - With
operator=name, initial conditions are not computed and the result is a polynomial in that name, orL(name)=qfor an inhomogeneous recurrence.
Examples
> with(gfun):
rec1:=u(n+1)=(n+1)*u(n):
rec2 := u(n+1)=2*u(n):
`rec+rec`(rec1,rec2,u(n));
\[\{\left(2 n^{2}+2 n \right) u \! \left(n \right)+\left(-n^{2}-3 n +2\right) u \! \left(n +1\right)+\left(n -1\right) u \! \left(n +2\right), u \! \left(0\right) = \_C_{0}, u \! \left(1\right) = \_C_{1}, u \! \left(3\right) = 4 \_C_{0}+2 \_C_{1}\}\]
> `rec*rec`(rec1,rec2,u(n));
\[\left(-2 n -2\right) u \! \left(n \right)+u \! \left(n +1\right)\]
> cauchyproduct(rec1,rec2,u(n));
\[\{\left(2 n +4\right) u \! \left(n \right)+\left(-4-n \right) u \! \left(n +1\right)+u \! \left(n +2\right), u \! \left(0\right) = \_C_{0}, u \! \left(1\right) = 3 \_C_{0}\}\]
See Also
gfun, gfun[parameters], gfun[diffeq+diffeq], gfun[diffeq*diffeq], gfun[hadamardproduct]