Expansion of polynomials
Parameters
The expansion of (exponential) generating functions is performed by PolynomialFieldSequence
with constructors that have the following parameters:
offset:
first indexpolys:
a list of list of integers in square brackets, specifying the coefficients of a list of polynomials.postfix:
a string starting with a delimiter, followed by a list of elements that are separated by this delimiterdist:
an optional increment to the current indexgfType:
0 for an o.g.f., 1 for an e.g.f., +4 if the denominator should be returned instead of the numerator (default 0 = o.g.f)modulus, periodicity:
which element to take when zeros are to be suppressed. For example, even coefficients are selected by (0,2) and odd coefficients by (1,2).seqs:
a variable number of sequences defining subordinate generating functions
Generator Callcodes
The following callcodes of the generator use the specified parameter combinations:
poly (offset, polys, postfix) polyx (offset, polys, postfix, dist, gftype) polyz (offset, polys, postfix, dist, gftype, modulus, factor) polya (offset, polys, postfix, seqs) polyxa (offset, polys, postfix, dist, gftype, seqs) polyza (offset, polys, postfix, dist, gftype, modulus, factor, seqs)
Polynomials
The polynomials in polys are referenced by p0, p1, p2, ... where p0 gives the initial term of the iteration. A single polynomial is specified by the list of coefficients with increasing exponents, for example, 1-x = 1*x^0 -1*x^1 -> [1,-1]. Most often the initial p0 = "[1]" = 1.
The list of polynomials may optionally (for testing) be followed by a list of sequence numbers for subordinate generating functions, but normally such sequences should be specified as a separate trailign list of sequence instances.
Examples:
- A308847 Expansion of e.g.f. exp(-2*x) / BesselI(0,2*x).
A-number callcode offset p0=1,p1=2*x,p2=-2*x exp(p2)/besselI(0,p1) dist gftype=exp A308847 polyx 0 "[1],[0,2],[0,-2]" "p2,exp,0,p1,besselI,/" 0 1
- A345969 Expansion of the e.g.f.
1 / sqrt(3 - 2 / ((1 - x)*exp(x)))
- Maple:
a := series(1/sqrt(3-2/((1-x)*exp(x))), x=0, 25): seq(n!*coeff(a, x, n), n=0..24);
- jOEIS:
new PolynomialFieldSequence(0, "[[1],[1,-1]]" ",1,3,2,p1,x,exp,*,/,-,sqrt,/", 0, 1)
- Maple:
Postfix notation
The operations of the postfix string are performed in their sequential order. They operate on a stack, and the final result is the lowest stack element.
Special operators
A
push the generating function to be definedS, T, U, V
push the 1st, 2nd, 3rd, 4th generating function from the list of additional sequencesx
push the free variable0, 1, 2, ...
push an integern
push the current indexpi
push the predefined polynomial with index i (cf.polys
above)<i
shift the top stack element by i, i.e. multiply by xi^i
take the top stack element to the i-th power, wherei
can be an integer or a fraction (^1/2
issqrt
)dif
differentiate the top stack elementint
formal integration of the top stack elementsub
substitute, call the g.f.A
with the top stack element
Arithmetic operators, functions with 2 arguments
Replace the 2 top stack elements a, b by a op b, where op is one of:
+
-
*
/
agm
besselI
Functions with 1 argument
Replace the top stack element by the function's result:
abs
acosh
asin
asinh
atan
atanh
cos
cosh
cot
coth
csc
csch
ellipticD
ellipticE
ellipticK eta
exp
lambertW
log
neg
sec
sech
sin
sinh
sqrt
tan
tanh
catalan
(x) = (1 - sqrt(1 - 4*x)) / (2*x)
Subordinate generating functions
Any sequence implemented in jOEIS can be used as a subordinate generating function. Usual examples are the Eta Products and theta_3 = A000122, theta_4 = A002448.
Caveats
- Usually the g.f.s have offset 0 and start with a term 1, so
p0 = "1"
in most cases. The first polynomial p0 must always include the coefficient of x0, even if the offset is > 0, for example:p0 = "0,1"
. - Usually the parameter
dist
is not needed. Sometimes, it must be set to a value > 0 to start the iteration properly. sqrt
expects an argument of the form 1-x. sqrt(x) does not work, it can sometimes be avoided by quadrating all occurrences of x.
Commandline activation
A script OEIS-mat/scripts/poly
facilitates the testing of the polynomial expansions. It is activated with the following parameters and options:
poly polys postfix [-i dist] [-t gfTtype] [-n number of terms] [-o offset] [-d debug mode]