> < ^ From:

< ^ Subject:

Richard Puttock asked:

I am trying to factorise univariate polynomials over Z_p where p is

prime. So I typer:=UnivariatePolynomialRing(GF(13),"x");

p:=UnivariatePolynomial(r,[8,4,11,2]);

Factors(r,p);

`UnivariatePolynomial' creates a polynomial *over* the ring which is given

as the first argument. In your situation, you create a polynomial whose

coefficients would be polynomials again. GAP can not factor such iterated

polynomials.

Furthermore, GAP distinguishes between finite field elements and integers.

You'd have to multiply with the appropriate ``1'' to get the proper elements.

If you construct the polynomial as:

p:=UnivariatePolynomial(GF(13),[8,4,11,2]*Z(13)^0);

The factorization will work:

gap> f:=Factors(r,p); [ Z(13)+Z(13)*x, Z(13)^5+x, Z(13)^9+x ]

(Finally, you might want to use the operation `Int' to convert finite field

elements back to integers.)

gap> coeffs:=CoefficientsOfUnivariatePolynomial(f[2]); [ Z(13)^5, Z(13)^0 ] gap> List(coeffs,Int); [ 6, 1 ]

I hope this is of help,

Alexander Hulpke

> < [top]