gfun[guessgf] - find a generating function from a list
gfun[guesseqn] - find a differential equation satisfied by the generating function
Calling Sequence
guessgf(L, x, <[typelist]>)
guesseqn(L, y(x), <[typelist]>)
Parameters
L - list
x - name
y - name
[typelist] - (optional) list of generating function types
Description
- The procedure
guessgfattempts to find a closed form for the generating function for the series defined byL. The optional variabletypelistspecifies the kind of generating functions, (such as ordinary (ogf) or exponential (egf)) to try. For a full list of available choices see gftypes. - If
typelistcontains more than one element, these types are tried in order. - If
typelistis not provided, the default is specified by the parameteroptionsgf, initially['ogf'].
This function
1. first tries to find a rational function with listtoratpoly,
2. calls listtohypergeom to try to find hypergeometric functions,
3. tries listtoalgeq to find an algebraic equation,
4. tries listtodiffeq to find a linear differential equation with polynomial coefficients which is then passed to dsolve.
- The function
guesseqnonly tries to find an equation satisfied by the generating function. It might succeed whereguessgffails because it does not attempt to solve this equation in closed-form. - One should give as many terms as possible in the list
L.
Examples
> with(gfun):
guessgf([1,2,4,7,11,16,22],x);
\[-\frac{x^{2}-x +1}{\left(x -1\right)^{3}}\]
> guessgf([1,1,3,10,41,196,1057],x,['lgdegf']);
\[[{\mathrm e}^{x} \left(x +1\right), \mathit{lgdegf}]\]
> l:=[1, 4, 36, 400, 4900, 63504, 853776, 11778624, 165636900, 2363904400, 34134779536, 497634306624, 7312459672336]:
guesseqn(l,y(z));
\[\{4 y \! \left(z \right)+\left(32 z -1\right) \left(\frac{d}{d z}y \! \left(z \right)\right)+\left(16 z^{2}-z \right) \left(\frac{d^{2}}{d z^{2}}y \! \left(z \right)\right), y \! \left(0\right) = 1, D\! \left(y \right)\! \left(0\right) = 4\}\]
See Also
gfun, gfun[parameters], gfun[listtoseries], gfun[listtodiffeq], gfun[listtohypergeom], gfun[listtoratpoly]