MathGroup Archive 2012

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: primitive root error

  • To: mathgroup at
  • Subject: [mg128099] Re: primitive root error
  • From: Andrzej Kozlowski <akozlowski at>
  • Date: Sat, 15 Sep 2012 03:39:39 -0400 (EDT)
  • Delivered-to:
  • Delivered-to:
  • Delivered-to:
  • Delivered-to:
  • References: <>

I think it is just bad documentation. It seems that PrimitiveRoot[n] gives the smallest primitive root when n is a power of an odd prime. However, when g=PrimitiveRoot[p^k] is odd (where p is an odd prime) PrimitiveRoot[2 p^k] returns g+2^k, which is usually not the smallest primitive root. For example:



which is even. So now:



which is 6+41^2.

But the smallest PrimitiveRoot is:

  MultiplicativeOrder[#, 2*41^2] == EulerPhi[2*41^2] &]]


which is a lot smaller.

Andrzej Kozlowski

On 14 Sep 2012, at 06:24, Dan Dubin <ddubin at> wrote:

> The number theoretic function PrimitiveRoot[n]  is supposed to give the
> smallest generator for the multiplicative group of integers module n
> relatively prime to n.  However, Mathematica 8  says that
> PrimitiveRoot[18] equals 11. This is incorrect. While this is a
> generator, it is not the smallest generator of the group. The correct
> answer is 5:
> In[1]:= Table[Mod[5^n, 18], {n, 0, 6}]
> Out[1]= {1, 5, 7, 17, 13, 11, 1}

  • Prev by Date: Speed of VectorPlot3D Object and Mouse Rotation
  • Next by Date: Re: Landau letter, Re: Mathematica as a New Approach...
  • Previous by thread: Re: primitive root error
  • Next by thread: Re: primitive root error