# Not comprehending PowerMod

Bug introduced in 10.3 or earlier and persisting through 11.3.0 or later
The bug is not present in 10.0.

By definition, PowerMod[a, 1/r, m] finds a modular rth root of a mod m. Here's a pair of examples to illustrate my conundrum in 11.1.1/Win 10.

PowerMod[2488, 1/3, 10^4]
8992
8992^3
727057727488
Mod[PowerMod[2488, 1/3, 10^4]^3, 10^4] == 2488
False


Maybe pertinent is that the value returned above, 8992, is not contained in the corresponding PowerModList values:

PowerModList[2488, 1/3, 10^4]
{242, 2742, 5242, 7742}
Mod[PowerModList[2488, 1/3, 10^4]^3, 10^4]
{2488, 2488, 2488, 2488}


Similarly (if not identically) for

PowerMod[91175, 1/3, 10^5]
84375
84375^3
600677490234375
Mod[PowerMod[91175, 1/3, 10^5]^3, 10^5] == 91175
False


And, unlike the first example,

PowerModList[91175, 1/3, 10^5]
{}


In both cases it appears that PowerModList is correct ( PowerModList[91175, 1/3, 10^5] should not return anything, and it doesn't).

Much obliged for taking a look at this.

• 8992 is wrong. The PowerModList[] is correct. I'm not sure what else to say. I guess it's a bug? -- OK, maybe this: It seems to fail when $a$ and $m$ are not relatively prime. Jan 11 '19 at 21:18
• @Rabbit i also think that this is a bug. Please report this to Wolfram Support. Jan 11 '19 at 21:21
• It seems to be calculating the answer as Mod[2488^x,10^4] where x is determined by Solve[3 x == 1, x, Modulus -> EulerPhi[10^4]], which is wrong. Jan 11 '19 at 21:29
• Thanks @HenrikSchumacher - I let Wolfram support know of this. Jan 12 '19 at 1:50
• Wolfram case 4211704 Feb 19 '19 at 23:28