 rgf_sequence - Maple Help

genfunc

 rgf_sequence
 extract information about a sequence from its rational generating function Calling Sequence rgf_sequence(query, Fz, z, arg4, ...) Parameters

 query - name Fz - rational generating function z - name, generating function variable arg4 - additional arguments Description

 • This command determines information about the sequence encoded by the generating function Fz. All queries assume that the first nonzero term is the first term in the sequence.
 • The possible values for query are:

 'boundary' 'coeffs' 'delta' 'first' 'firstcf' 'firstrecur' 'order' 'recur'

 • The 'delta' query returns an expression sequence of delta terms that when added to the closed form expression of the sequence encoded by Fz, completely define the sequence. Each term in the expression sequence is an equality. The left hand side is the index of the term and the right hand side is the value to add to the closed form expression of the sequence to obtain the value of that term.
 • The 'boundary' query returns an expression sequence of boundary conditions for the sequence defined by Fz. Each term in the expression sequence  is an equality. The left hand side is the index of the term and the right hand side is the value of the term at that index. A function name can be used as an optional argument arg4, In this case the left hand side of each term in the expression sequence will be the sequence name and index for the boundary term.
 • The 'coeffs' query returns an ordered expression sequence of the coefficients of the recurrence that defines the sequence encoded by Fz. The recurrence is taken to have the form $t\left(n\right)=\sum _{i=1}^{k}a\left(i\right)t\left(n-i\right)$ and the sequence is returned in the order $a\left(1\right),...,a\left(k\right)$. A function name may be used as an optional argument arg4, in which case an expression sequence of equations is returned. The left hand side of each equation is an indexed name for the coefficient and the right hand side is the value of the coefficient.
 • The 'first' query determines the index of the first nonzero term in the sequence encoded by Fz.
 • The 'firstcf' query determines the minimum index from which all terms in the sequence encoded by Fz are defined by the sequence's closed form expansion.
 • The 'firstrecur' query determines the minimum index from which the recurrence defining the sequence encoded by Fz holds.
 • The 'order' query returns the order of the recurrence defining Fz.
 • The 'recur' query determines the recurrence that defines the sequence encoded by the generating function Fz. This query requires that argument arg4 be a function name and argument arg5 be the name of an index variable for the function.
 • The 'coeffs' and 'recur' queries return the value FAIL if Fz is a trivial rational generating function.
 • The command with(genfunc,rgf_sequence) allows the use of the abbreviated form of this command. Examples

 > $\mathrm{with}\left(\mathrm{genfunc}\right):$
 > $\mathrm{Gy}≔\frac{1+{y}^{2}}{1-y-{y}^{2}}:$
 > $\mathrm{rgf_sequence}\left('\mathrm{boundary}',\mathrm{Gy},y\right)$
 ${0}{=}{1}{,}{1}{=}{1}{,}{2}{=}{3}$ (1)
 > $\mathrm{rgf_sequence}\left('\mathrm{boundary}',\mathrm{Gy},y,t\right)$
 ${t}{}\left({0}\right){=}{1}{,}{t}{}\left({1}\right){=}{1}{,}{t}{}\left({2}\right){=}{3}$ (2)
 > $\mathrm{rgf_sequence}\left('\mathrm{coeffs}',\mathrm{Gy},y\right)$
 ${1}{,}{1}$ (3)
 > $\mathrm{rgf_sequence}\left('\mathrm{coeffs}',\mathrm{Gy},y,'a'\right)$
 ${a}{}\left({1}\right){=}{1}{,}{a}{}\left({2}\right){=}{1}$ (4)
 > $\mathrm{rgf_sequence}\left('\mathrm{\delta }',\mathrm{Gy},y\right)$
 ${0}{=}{-1}$ (5)
 > $\mathrm{rgf_sequence}\left('\mathrm{first}',\mathrm{Gy},y\right)$
 ${0}$ (6)
 > $\mathrm{rgf_sequence}\left('\mathrm{firstcf}',\mathrm{Gy},y\right)$
 ${1}$ (7)
 > $\mathrm{rgf_sequence}\left('\mathrm{firstrecur}',\mathrm{Gy},y\right)$
 ${3}$ (8)
 > $\mathrm{rgf_sequence}\left('\mathrm{order}',\mathrm{Gy},y\right)$
 ${2}$ (9)
 > $\mathrm{rgf_sequence}\left('\mathrm{recur}',\mathrm{Gy},y,t,k\right)$
 ${t}{}\left({k}\right){=}{t}{}\left({k}{-}{1}\right){+}{t}{}\left({k}{-}{2}\right)$ (10)