Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Modulo
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Properties (identities)== {{see also|Modular arithmetic#Properties}} Some modulo operations can be factored or expanded similarly to other mathematical operations. This may be useful in [[cryptography]] proofs, such as the [[Diffie–Hellman key exchange]]. The properties involving multiplication, division, and exponentiation generally require that {{math|''a''}} and {{math|''n''}} are integers. * Identity: ** {{math|(''a'' mod ''n'') mod ''n'' {{=}} ''a'' mod ''n''}}. ** {{math|''n''{{sup|''x''}} mod ''n'' {{=}} 0}} for all positive integer values of {{math|''x''}}. ** If {{math|''p''}} is a [[prime number]] which is not a [[divisor]] of {{math|''b''}}, then {{math|''ab''{{i sup|''p''−1}} mod ''p'' {{=}} ''a'' mod ''p''}}, due to [[Fermat's little theorem]]. * Inverse: ** {{math|[(−''a'' mod ''n'') + (''a'' mod ''n'')] mod ''n'' {{=}} 0}}. ** {{math|''b''{{sup|−1}} mod ''n''}} denotes the [[modular multiplicative inverse]], which is defined [[if and only if]] {{math|''b''}} and {{math|''n''}} are [[relatively prime]], which is the case when the left hand side is defined: {{math|[(''b''{{sup|−1}} mod ''n'')(''b'' mod ''n'')] mod ''n'' {{=}} 1}}. * Distributive: ** {{math|(''a'' + ''b'') mod ''n'' {{=}} [(''a'' mod ''n'') + (''b'' mod ''n'')] mod ''n''}}. ** {{math|''ab'' mod ''n'' {{=}} [(''a'' mod ''n'')(''b'' mod ''n'')] mod ''n''}}. * Division (definition): {{math|{{sfrac|''a''|''b''}} mod ''n'' {{=}} [(''a'' mod ''n'')(''b''{{sup|−1}} mod ''n'')] mod ''n''}}, when the right hand side is defined (that is when {{math|''b''}} and {{math|''n''}} are [[coprime]]), and undefined otherwise. * Inverse multiplication: {{math|[(''ab'' mod ''n'')(''b''{{sup|−1}} mod ''n'')] mod ''n'' {{=}} ''a'' mod ''n''}}.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)