PRODUCTS
Mathematica
Mathematica Home Edition
Mathematica for Students
Mathematica for the Classroom
grid
Mathematica
Wolfram Lightweight Grid Manager
web
Mathematica
Mathematica Player
(free download)
Mathematica Player Pro
Wolfram
Workbench
Mathematica
Applications
SOLUTIONS
Industry
Chemical Engineering
Image Processing
Mechanical Engineering
Petroleum Engineering
Environmental Sciences
Bioinformatics
Data Analysis and Mining
Financial Risk Management
Statistics
Software Engineering
More...
Education
Higher Education
Precollege Education
Students
Technology
Interactive Deployment
High-Performance and Parallel Computing (HPC)
See Also: Technology Guide
PURCHASE
Online Store
Other Ways to Buy
Volume & Site Licensing
Contact Sales
Software
Service
Upgrades
Training
Books
FOR USERS
All User Resources
Product Registration
Technical Support
Customer Service
Developer Support
Does My Site Have a License?
Free Seminars
Learning Center
Training
Custom Group Seminars
Documentation & Examples
Tutorial Screencasts
Video Gallery
Demonstrations Project
Education Portal
Student Resources
COMPANY
About Wolfram Research
News & Events
Wolfram Blog
Employment Opportunities
History of
Mathematica
Stephen Wolfram's Home Page
Contact Us
OUR SITES
Wolfram|Alpha
Demonstrations Project
Wolfram Blog
MathWorld
Integrator
Wolfram Functions Site
Mathematica Journal
Wolfram Library Archive
Wolfram
Tones
Wolfram Science
Stephen Wolfram
DOCUMENTATION CENTER SEARCH
Mathematica
>
Mathematics and Algorithms
>
Number Theory
>
Built-in
Mathematica
Symbol
Integer and Number Theoretic Functions
Tutorials »
|
Mod
Power
PowerModList
ExtendedGCD
MultiplicativeOrder
EulerPhi
PrimitiveRoot
See Also »
|
Cryptographic Number Theory
Diophantine Equations
Integer Functions
Multiplicative Number Theory
Number Theoretic Functions
Number Theory
More About »
PowerMod
PowerMod
[
a
,
b
,
m
]
gives
a
b
mod
m
.
PowerMod
[
a
, -1,
m
]
finds the modular inverse of
a
modulo
m
.
PowerMod
[
a
, 1/
r
,
m
]
finds the smallest modular root of
a
.
MORE INFORMATION
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
CLOSE ALL
Basic Examples
(1)
In[1]:=
Out[1]=
In[2]:=
Out[2]=
Scope
(3)
Generalizations & Extensions
(1)
Properties & Relations
(1)
Possible Issues
(1)
SEE ALSO
Mod
Power
PowerModList
ExtendedGCD
MultiplicativeOrder
EulerPhi
PrimitiveRoot
TUTORIALS
Integer and Number Theoretic Functions
MORE ABOUT
Cryptographic Number Theory
Diophantine Equations
Integer Functions
Multiplicative Number Theory
Number Theoretic Functions
Number Theory
RELATED LINKS
Demonstrations with PowerMod
(
Wolfram Demonstrations Project
)
NKS|Online
(
A New Kind of Science
)
New in 1