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.

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 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.