2
$\begingroup$

First, note that $4^{96}\equiv 96 \pmod {100}$.

Mathematica claims that PowerMod[96, 1/96, 100] has no integer solutions.

Even more obviously wrong, I get {} for

Solve[4^96 == x^96, Modulus -> 100]

which obviously has at least one solution (4).

Is this a known bug? Can I work around it somehow?

EDIT: I'm on Mathematica 9.0.1, running on OSX 10.10 Yosemite developer beta. Perhaps that could be the cause of this issue for me (also, mathematica crashes whenever I try to paste.).

$\endgroup$
4
  • $\begingroup$ Yes, I think this is a bug in PowerMod, although your second example doesn't give a wrong result for me (version 8.0.4). $\endgroup$
    – Jens
    Commented Jun 8, 2014 at 3:41
  • $\begingroup$ I have had that crash before, too. It seems that it can be avoided if you copy from Mathematica as plain text (see the Edit menu under Copy as...). $\endgroup$
    – Jens
    Commented Jun 8, 2014 at 4:41
  • $\begingroup$ I removed the version-9 tag because for the current version we don't need a special tag. Let me know if you disagree. $\endgroup$
    – Jens
    Commented Jun 8, 2014 at 4:44
  • $\begingroup$ Will investigate. $\endgroup$ Commented Jun 8, 2014 at 20:55

2 Answers 2

3
$\begingroup$
Solve[4^96 == x^96, Modulus -> 100]
Solve[x^96 == 96, x, Modulus -> 100]
PowerModList[96, 1/96, 100]

(*
{{x -> 4}, {x -> 22}, {x -> 28}, {x -> 46}, {x -> 54}, {x -> 72}, {x -> 78}, {x -> 96}}
{{x -> 4}, {x -> 22}, {x -> 28}, {x -> 46}, {x -> 54}, {x -> 72}, {x -> 78}, {x -> 96}}
{4,22,28,46,54,72,78,96}
*)
$\endgroup$
5
  • $\begingroup$ Are you on mathematica 9? $\endgroup$
    – aaazalea
    Commented Jun 8, 2014 at 4:16
  • $\begingroup$ @JakobWeisblat: Yes. $\endgroup$
    – ciao
    Commented Jun 8, 2014 at 4:38
  • $\begingroup$ Did you try with PowerMod instead of PowerModList? $\endgroup$
    – aaazalea
    Commented Jun 8, 2014 at 4:59
  • $\begingroup$ @JakobWeisblat: No. You asked for a work-around. I gave you one. I have not used PowerMod for years, no reason to, PowerModList is equivalent for non-Nth-root use, and gives complete results for Nth-root, so once it left being experimental (pre V6), I use it. I suspect this may be a bug in PowerMod - that function has existed, unchanged AFAIK, since V1. $\endgroup$
    – ciao
    Commented Jun 8, 2014 at 5:03
  • $\begingroup$ I did switch to using PowerModList and have not run into this problem again, so now that you mention it I wonder why I still care about the PowerMid issue. $\endgroup$
    – aaazalea
    Commented Jun 8, 2014 at 5:05
2
$\begingroup$

It works on a Mac with v9.0.1

$Version

"9.0 for Mac OS X x86 (64-bit) (January 24, 2013)"

pml = PowerModList[96, 1/96, 100]

{4, 22, 28, 46, 54, 72, 78, 96}

And @@ (Mod[#^96, 100] === PowerMod[#, 96, 100] === 96 & /@ pml)

True

pml === (x /. Solve[4^96 == x^96, Modulus -> 100])

True

$\endgroup$
1
  • 1
    $\begingroup$ I have the exact same version - it works for me with PowerModList but not PowerMod. $\endgroup$
    – aaazalea
    Commented Jun 8, 2014 at 4:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.