PowerMod

PowerMod[a,b,m]

gives ab mod m.

PowerMod[a,-1,m]

finds the modular inverse of a modulo m.

PowerMod[a,1/r,m]

finds a modular r^(th) root of a.

Details

  • Integer mathematical function, suitable for both symbolic and numerical manipulation.
  • For positive b, PowerMod[a,b,m] gives the same result as Mod[a^b, m] but is much more efficient.
  • PowerMod[a,b,m] allows negative and rational values of b. It returns unevaluated if the corresponding modular inverse or root does not exist.
  • PowerMod automatically threads over lists.

Examples

open allclose all

Basic Examples  (1)

In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=

Scope  (3)

Generalizations & Extensions  (1)

Properties & Relations  (1)

Possible Issues  (1)

See Also

PowerModList  ModularInverse  Mod  Power  ExtendedGCD  MultiplicativeOrder  EulerPhi  PrimitiveRoot

Tutorials

Introduced in 1988
(1.0)