Gerhard Niklasch on Tue, 10 Nov 1998 21:54:53 +0100 (MET)


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: znstar and all


In response to:
> Message-Id: <199811101447.PAA16697@erato.univ-lille1.fr>
> Date: Tue, 10 Nov 1998 15:47:39 +0100 (MET)
> From: Olivier Ramare <ramare@gat.univ-lille1.fr>
> Subject: znstar and all
> 
>   Help required : working with the multiplicative group of
> Z/nZ, I discovered  znstar, znprimroot and znorder. But once we
> have a primitive root, how to get the logarithm with respect to the
> given primitive root ? It is surely somewhere...

Here's one method  (which is something of an overkill - or, to put
it in friendlier words, which generalizes painlessly ;^) :

(21:44) gp > nf=nfinit(x);
(21:44) gp > zm11=idealstar(nf,11,2);
(21:45) gp > ideallog(nf,3,zm11)
%3 = [8]~
(21:45) gp > Mod(2,11)^8
%4 = Mod(3, 11)
(21:46) gp > ideallog(nf,5,zm11)
%5 = [4]~
(21:48) gp > Mod(2,11)^4
%6 = Mod(5, 11)
(21:48) gp > 

Enjoy, Gerhard