Bill Allombert on Mon, 20 May 2002 12:51:53 +0200 |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: primitive and irriducible polynomials |
On Mon, May 20, 2002 at 12:23:18PM +0200, Chiara Salvini wrote: > Hello everybody, > I'm trying to realize a Pari program which allows to determine: > - #(the number of){irriducible trinomials in Fp with degree=k} > - #(the number of){primitive trinomials in Fp with degree=k} > for p=2,....,100 and k=3,...6 > Can someone help me? trinomial(p,k)= { local(c=0,P); for(m=1,k-1, for(am=0,p-1, for(a0=1,p-1,/*If a0=0 we are not irreducible*/ P=x^k+am*x^m+a0; c+=polisirreducible(P*Mod(1,p))))); c*(p-1);/*Account for non monic polynomials*/ } count(pmax,kmax)= { local(c); forprime(p=2,pmax, for(k=3,kmax, c=trinomial(p,k); print(p,":",k,":",c))); } count(100,6) should be close of what you want. For the second question, please read carefully the program of Paul van Wamelen, in the previous post on this list. (I hope it is not an exam question :-) Cheers, Bill.