## Re: [PrimeNumbers] Re: multiplicative group mod M: I claim cyclic iff M=odd prime power or M<6.

Expand Messages
• ... I have just downloaded version 2.5.3, which also says: znprimroot(n): returns a primitive root of n when it exists. What I was trying to convey is that
Message 1 of 6 , Jan 7, 2013
On 1/7/2013 8:38 AM, djbroadhurst wrote:
>
> David Cleaver wrote:
>
> > Pari/GP has a function called znprimroot()
>
> Which works perfectly, with
> > GP/PARI CALCULATOR Version 2.5.0 (released)
> if you will read the friendly manual:
> > znprimroot(n): returns a primitive root of n when it exists.

znprimroot(n): returns a primitive root of n when it exists.

What I was trying to convey is that Pari/GP can also return what looks like a
valid answer, even though the input does not have a primitive root, ie:

? znprimroot(15)
%1 = Mod(2, 15)

? znprimroot(30)
%2 = Mod(17, 30)

? znprimroot(33)
%3 = Mod(5, 33)

? znprimroot(91)
%4 = Mod(2, 91)

I have read the fine/friendly manual, ie ?znprimroot. However, this says
nothing about what happens when the primitive root does not exist. I have found
several places online that do discuss that the result in those situations will
be "undefined", like here:
http://pari.math.u-bordeaux.fr/dochtml/html/Arithmetic_functions.html

However, I believe we are in complete agreement that when you want a primitive
root of numbers that have (at least) one, then you can use the znprimroot()
function in Pari/GP to find it.

-David C.
• ... I imagine that GP returns an element of maximum order. Iff the group is cyclic this is a primitive root, with order eulerphi(n). All of this is perfectly
Message 2 of 6 , Jan 8, 2013
David Cleaver wrote:

> What I was trying to convey is that Pari/GP can also
> return what looks like a valid answer, even though the
> input does not have a primitive root

I imagine that GP returns an element of maximum order.
Iff the group is cyclic this is a primitive root,
with order eulerphi(n). All of this is perfectly
consistent with the rubric:

znprimroot(n): returns a primitive root of n when it exists.

as we both agree.

David
Your message has been successfully submitted and would be delivered to recipients shortly.