       Re: PowerMod[] - Mathematica 5.0 - problem/error/bug?

• To: mathgroup at smc.vnet.net
• Subject: [mg73040] Re: PowerMod[] - Mathematica 5.0 - problem/error/bug?
• From: dh <dh at metrohm.ch>
• Date: Tue, 30 Jan 2007 23:32:33 -0500 (EST)
• References: <epn9t2\$chv\$1@smc.vnet.net>

```
Hi Anton,

\$Version -> 5.1 for Microsoft Windows (October 25, 2004)

with this version it works just fine.

Daniel

Anton Vrba wrote:

> In Mathematica 5.0 I found on my system the following incorrect result regarding the PowerMod[] function

>

>   You agree that PowerMod[2,17 p, p]=2^17 for p prime and p>2^17

>

>   Mathematica 5.0 calculates PowerMod[2,17 p, p] as 2^2

>   for p=126322571 through to p=2147483647. (one can change the 2 to any base and the wrong answer base^2 is calculated)

>

>   below the notebook file converted to text format.

>

>   Have I a problem in my system? or is this a Mathematica 5.0 bug or possibly a new Pentium bug?

>

>   best regards

>   Anton

>

>   In:=

>   p=Prime

>   y=PowerMod[2,17  p,p]

>   FactorInteger[y]

>   "y is the correct result"

>

>   p=Prime

>   y=PowerMod[2,17  p,p]

>   FactorInteger[y]

>   "y should equal 2^17 and not 2^2"

>

>   m=5

>   y=PowerMod[2,(2^(32 m)-1)  p,p]

>   FactorInteger[y]

>   m=12

>   y=PowerMod[2,(2^(32 m)-1)  p,p]

>   FactorInteger[y]

>   "y equal 2^(m+1) is a cute result"

>

>   Out=2543568329

>   Out=131072

>   Out={{2,17}}

>   Out=y is the correct result

>   Out=2112226087

>   Out=4

>   Out={{2,2}}

>   Out=y should equal 2^17 and not 2^2

>   Out=5

>   Out=64

>   Out={{2,6}}

>   Out=12

>   Out=8192

>   Out={{2,13}}

>   Out=y equal 2^(m+1) is a cute result

>

>   In:=

>   "here is the range of the error"

>   p=Prime

>   FactorInteger[PowerMod[2,17  p,p]]

>   p=Prime[7181138+1]

>   FactorInteger[PowerMod[2,17  p,p]]

>   p=Prime

>   FactorInteger[PowerMod[2,17  p,p]]

>   p=Prime[105097565+1]

>   FactorInteger[PowerMod[2,17  p,p]]

>   Out=here is the range of the error

>   Out=126322543

>   Out={{2,17}}

>   Out=126322571

>   Out={{2,2}}

>   Out=2147483647

>   Out={{2,2}}

>   Out=2147483659

>   Out={{2,17}}

>

>

>

```

• Prev by Date: WhichRootOfUnity
• Next by Date: Re: PowerMod[] - Mathematica 5.0 - problem/error/bug?
• Previous by thread: PowerMod[] - Mathematica 5.0 - problem/error/bug?
• Next by thread: Re: PowerMod[] - Mathematica 5.0 - problem/error/bug?