2 * Functions and Variables for ggf::
5 @node Functions and Variables for ggf, , Package ggf, Package ggf
6 @section Functions and Variables for ggf
8 @defvr {Option variable} GGFINFINITY
11 This is an option variable for function @code{ggf}.
13 When computing the continued fraction of the
14 generating function, a partial quotient having a degree
15 (strictly) greater than @var{GGFINFINITY} will be discarded and
16 the current convergent will be considered as the exact value
17 of the generating function; most often the degree of all
18 partial quotients will be 0 or 1; if you use a greater value,
19 then you should give enough terms in order to make the
20 computation accurate enough.
25 @opencatbox{Categories:}
26 @category{Package ggf}
32 @defvr {Option variable} GGFCFMAX
35 This is an option variable for function @code{ggf}.
37 When computing the continued fraction of the
38 generating function, if no good result has been found (see
39 the @var{GGFINFINITY} flag) after having computed @var{GGFCFMAX} partial
40 quotients, the generating function will be considered as
41 not being a fraction of two polynomials and the function will
42 exit. Put freely a greater value for more complicated
47 @opencatbox{Categories:}
48 @category{Package ggf}
54 @deffn {Function} ggf (@var{l})
55 Compute the generating function (if it is a fraction of two
56 polynomials) of a sequence, its first terms being given. @var{l}
59 The solution is returned as a fraction of two polynomials.
60 If no solution has been found, it returns with @code{done}.
62 This function is controlled by global variables @var{GGFINFINITY} and @var{GGFCFMAX}. See also @var{GGFINFINITY} and @var{GGFCFMAX}.
64 To use this function write first @code{load("ggf")}.
66 @c These examples are from comments in the file share/contrib/ggf.mac.
69 (%i2) makelist(fib(n),n,0,10);
70 (%o2) [0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55]
76 (%i4) taylor(%,x,0,10);
78 (%o4)/T/ x + x + 2 x + 3 x + 5 x + 8 x + 13 x + 21 x + 34 x + 55 x
80 (%i5) makelist(2*fib(n+1)-fib(n),n,0,10);
81 (%o5) [2, 1, 3, 4, 7, 11, 18, 29, 47, 76, 123]
87 (%i7) taylor(%,x,0,10);
89 (%o7)/T/ 2 + x + 3 x + 4 x + 7 x + 11 x + 18 x + 29 x + 47 x + 76 x
94 As these examples show, the generating function does create a function
95 whose Taylor series has coefficients that are the elements of the
97 @opencatbox{Categories:}
98 @category{Generating functions}
99 @category{Share packages}
100 @category{Package ggf}