gfun[listtorec] - find a recurrence for the elements

gfun[seriestorec] - find a recurrence for the coefficients of a series

Calling Sequence

listtorec(l, u(n), <[typelist]>, <operator=op>)

seriestorec(s, u(n), <[typelist]>, <operator=op>)

Parameters

l - a list

s - a series

u(n) - the unknown function and its variable

[typelist] - (optional) a list of generating function types

operator=op - (optional) output form, where op is equation or a name

Description

Examples

> with(gfun):
l:=[1, 1, 2, 5, 14, 42, 132, 429, 1430, 4862, 16796, 58786]:
rec:=listtorec(l,u(n));
\[\{\left(-4 n -2\right) u \! \left(n \right)+\left(n +2\right) u \! \left(n +1\right), u \! \left(0\right) = 1\}\]
> rsolve(op(1,rec),u(n));
\[\frac{4^{n} \Gamma \! \left(n +\frac{1}{2}\right) u \! \left(0\right)}{\sqrt{\pi}\, \Gamma \! \left(n +2\right)}\]
> rec2:=seriestorec(series(add(l[i]*x^(i-1)*(i-1)!, i=1..nops(l))+O(x^nops(l)),x, 12), u(n), ['egf']);
\[[\{\left(-4 n -2\right) u \! \left(n \right)+\left(n +2\right) u \! \left(n +1\right), u \! \left(0\right) = 1\}, \mathit{egf}]\]
> listtorec(l,u(n),operator=Sn);
\[-4 n -2+\left(n +2\right) \mathit{Sn}\]

See Also

gfun, gfun[parameters]