MultiplicativeOrder
The smallest positive k such that a^k ≡ 1 (mod n).
✓ checked against that system · ! checked, with disagreements (hover a chip)Wikipedia
Multiplicative orderMathWorldMultiplicativeOrderWikidataQ282723Wolfram LanguageMultiplicativeOrder!MultiplicativeOrder(a, n)smallest positive with .SageMath
Mod(a, n).multiplicative_order()SymPyn_order(a, n)MultiplicativeOrder(a, n, {r1, r2, …})smallest positive with for some — a discrete logarithmMultiplicativeOrder(ResidueClass(a, n))the order of a unit of SageMath
Mod(a, n).multiplicative_order()SymPyn_order(a, n)Typed signatures
| Type | Package | Applies |
|---|---|---|
(integer, integer, list<integer>?) -> integer | compute-engine | always |
(value, integer?, list<integer>?) -> integer | residuesreplaces compute-engine | always |
Details
- Also called the modulo order; defined only when , since otherwise no power of can reach 1 mod .
- Always divides , by Lagrange's theorem applied to the group of units mod . See Totient.
- Unevaluated when no order exists.
- Computed from Carmichael's by stripping primes off it, so and each must be factored.
- The three-argument form is a discrete logarithm, by Pohlig–Hellman over the order of and baby-step giant-step within each prime: the cost is for the largest prime dividing that order — instant for a smooth order, hopeless for a safe prime.
Plot
argument a of type value has no control
Examples
3 more kept as data, checked against the oraclesScope #
Possible issues #
About
| Examples | 26 |
|---|---|
| Checked against | Wolfram Language 22 agree2 differ2 errorSageMath 16 agree1 errorSymPy 13 agree4 error |
| Crosswalk | WikipediaMathWorldWikidataWolfram LanguageSageMathSymPy |
Implementation
mapped
sagepackages/oracle/src/mappings.tsmapped
sympypackages/oracle/src/mappings.tsn_order raises where gcd(a, n) is not 1, as ours stays unevaluated. The three-argument discrete logarithm over a list of targets has no one-call SymPy form (discrete_log takes one target).
See also: PowerMod