
genpoly - creates a polynomial using a b-adic expansion

Calling sequence:
genpoly(integer, integer_1, expr_2)
genpoly(poly, integer_1, expr_2)
genpoly(expr [ , indets ], integer_1, expr_2)
indets  ---> [ expr_1 ...]

Parameter:
integer                 --  integer
integer_1               --  integer larger than 1
poly                    --  polynomial
expr, expr_1, expr_2    --  expressions

Overloading:

1

Summary:

genpoly(n,b,x) creates a polynomial in the variable x from an integer n by
using a b-adic expansion. b must be an integer larger than 1.

The b-adic expansion of n is defined as n = sum( c[i]*b^i, i=0..m ),
such that the c[i] are integers modulo b and the modulus is calculated

symmetrically.  Through this expansion the polynomial sum( c[i]*x^i,
i=0..m ) is created.  The polynomial is defined over the coefficient ring
Expr.

If the first argument of genpoly is a polynomial then this must have the
coefficient ring Expr and may only have integer coefficients. Furthermore, the
third argument must not be a variable of the polynomial. In this case each
coefficient is b-adic expanded to a polynomial in x. The result is a polynomial
with the variable x, followed by the variables of the given polynomial (x is
the main variable of the new polynomial).

The first argument may also be an expressionand optionally a listof variables.
If the argument is an expression then this is converted into a polynomial (see
function poly).

If the first argument is an integer then the result is a polynomial. If it is a
polynomial or an expression then the result has the same type. genpoly is a
kernel function.

>>  genpoly(15, 7, x);

      poly(x*2 + 1, [x])

>>  genpoly(15*y^2 - 6*y + 3, 7, x);

      x*y^2*2 - x*y + y^2 + y + 3

>>  genpoly(poly(15*y^2 + 8*z, [y, z]), 7, x);

      poly(x*y^2*2 + x*z + y^2 + z, [x, y, z])

See also:  evalp , poly

