mostly on computers and mathematics
in Pari/GP this function tests if q is a primitive root (generator) of the field Zp.
isprimroot(q,p) = ff= factor(p-1); y=matsize(ff); for(i=1,y[1],if(Mod(1,p)==Mod(q,p)^((p-1)/ff[i,1]),return(0))); return(1)
Post a Comment
No comments :
Post a Comment