Re: Primitive Polynomials

Bill Allombert <[email protected]>
Newsgroups gmane.comp.mathematics.pari.devel
Message-ID <Y2TVrTtC9X2qyzaG@seventeen>
On Fri, Nov 04, 2022 at 09:54:37AM +0100, Martin Becker wrote:
> 
> Hello,
> 
> I would like to have an option for ffgen to return a primitive
> polynomial rather than just some random irreducible polynomial.
> Preferrably a Conway polynomial but, for many use cases,
> any will do.  Would that be hard to implement?  Pari could
> iterate through irreducible polynomials until Mod(x,candidate)
> has maximal order.  Please excuse me if that functionality is
> already present somewhere but I didn't notice.

It is indirectly possible by using ffprimroot:
minpoly(ffprimroot(ffgen([p,n])))

? minpoly(ffprimroot(ffgen([7,5])))
%1 = Mod(1,7)*x^5+Mod(2,7)*x^4+Mod(4,7)*x^3+Mod(2,7)*x^2+Mod(4,7)*x+Mod(2,7)

Cheers,
Bill.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.