Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #11757

Re: primitive root error

From Andrzej Kozlowski <akozlowski@gmail.com>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: primitive root error
Date 2012-09-15 07:46 +0000
Message-ID <k31bo6$mqi$1@smc.vnet.net> (permalink)
References <20120914042435.8DEC1684C@smc.vnet.net>
Organization Time-Warner Telecom

Show all headers | View raw


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:

PrimitiveRoot[41^2]

 6

which is even. So now:

PrimitiveRoot[2*41^2]

1687

which is 6+41^2.

But the smallest PrimitiveRoot is:

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

7

which is a lot smaller.


Andrzej Kozlowski


On 14 Sep 2012, at 06:24, Dan Dubin <ddubin@ucsd.edu> 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}
>

Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread


Thread

Re: primitive root error Andrzej Kozlowski <akozlowski@gmail.com> - 2012-09-15 07:46 +0000

csiph-web