Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #11759
| From | Andrzej Kozlowski <akozlowski@gmail.com> |
|---|---|
| Newsgroups | comp.soft-sys.math.mathematica |
| Subject | Re: primitive root error |
| Date | 2012-09-16 07:22 +0000 |
| Message-ID | <k33un1$qtc$1@smc.vnet.net> (permalink) |
| References | <k2ub15$h9h$1@smc.vnet.net> <20120915073839.53E3C6859@smc.vnet.net> |
| Organization | Time-Warner Telecom |
On 15 Sep 2012, at 09:38, daniel.lichtblau0@gmail.com wrote:
> On Thursday, September 13, 2012 11:16:47 PM UTC-5, Dan Dubin 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}
>
> Me, I'd call that a mistake in the documentation. Anyway, you can get the smallest by resorting to a crude, nay, barbaric tactic: invoke Wolfram|Alpha to find all the primitive roots.
>
> In[71]:= WolframAlpha["primitive roots of 18", "MathematicaResult"]
>
> Out[71]= {5, 11}
>
> Daniel Lichtblau
> Wolfram Research
>
>
>
This does indeed seem a little barbaric since:
WolframAlpha["primitive roots of 18", "MathematicaResult"] // Timing
{1.87481,{5,11}}
Select[Range[18],
MultiplicativeOrder[#, 18] == EulerPhi[18] &] // Timing
{0.000347,{5,11}}
Andrzej Kozlowski
Back to comp.soft-sys.math.mathematica | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
primitive root error Dan Dubin <ddubin@ucsd.edu> - 2012-09-14 04:15 +0000 Re: primitive root error daniel.lichtblau0@gmail.com - 2012-09-15 07:45 +0000 Re: primitive root error Andrzej Kozlowski <akozlowski@gmail.com> - 2012-09-16 07:22 +0000 Re: primitive root error danl@wolfram.com - 2012-09-18 07:46 +0000
csiph-web