Skip to content
Surf Wiki
Save to docs
general/modular-arithmetic

From Surf Wiki (app.surf) — the open knowledge base

Multiplicative order

Concept in modular arithmetic


Concept in modular arithmetic

In number theory, given a positive integer n and an integer a coprime to n, the multiplicative order of a modulo n is the smallest positive integer k such that a^k\ \equiv\ 1 \pmod n.

In other words, the multiplicative order of a modulo n is the order of a in the multiplicative group of the units in the ring of the integers modulo n.

The order of a modulo n is sometimes written as \operatorname{ord}_n(a).

Example

The powers of 4 modulo 7 are as follows:

: \begin{array}{llll} 4^0 &= 1 &=0 \times 7 + 1 &\equiv 1\pmod7 \ 4^1 &= 4 &=0 \times 7 + 4 &\equiv 4\pmod7 \ 4^2 &= 16 &=2 \times 7 + 2 &\equiv 2\pmod7 \ 4^3 &= 64 &=9 \times 7 + 1 &\equiv 1\pmod7 \ 4^4 &= 256 &=36 \times 7 + 4 &\equiv 4\pmod7 \ 4^5 &= 1024 &=146 \times 7 + 2 &\equiv 2\pmod7 \ \vdots\end{array}

The smallest positive integer k such that 4k ≡ 1 (mod 7) is 3, so the order of 4 (mod 7) is 3.

Properties

Even without knowledge that we are working in the multiplicative group of integers modulo n, we can show that a actually has an order by noting that the powers of a can only take a finite number of different values modulo n, so according to the pigeonhole principle there must be two powers, say s and t and without loss of generality s t, such that a**sa**t (mod n). Since a and n are coprime, a has an inverse element a−1 and we can multiply both sides of the congruence with at, yielding a**st ≡ 1 (mod n).

The concept of multiplicative order is a special case of the order of group elements. The multiplicative order of a number a modulo n is the order of a in the multiplicative group whose elements are the residues modulo n of the numbers coprime to n, and whose group operation is multiplication modulo n. This is the group of units of the ring Zn; it has φ(n) elements, φ being Euler's totient function, and is denoted as U(n) or U(Zn).

As a consequence of Lagrange's theorem, the order of a (mod n) always divides φ(n). If the order of a is actually equal to φ(n), and therefore as large as possible, then a is called a primitive root modulo n. This means that the group U(n) is cyclic and the residue class of a generates it.

The order of a (mod n) also divides λ(n), a value of the Carmichael function, which is an even stronger statement than the divisibility of φ(n).

Programming languages

  • Maxima CAS: zn_order (a, n)
  • Wolfram Language: MultiplicativeOrder[k, n]
  • Rosetta Code - examples of multiplicative order in various languages

References

References

  1. {{harnvb. Niven. Zuckerman. Montgomery. 1991
  2. (2013). "Modern Computer Algebra". Cambridge University Press.
  3. [https://maxima.sourceforge.net/docs/manual/maxima_29.html#zn_005forder Maxima 5.42.0 Manual: zn_order]
  4. [https://reference.wolfram.com/language/ref/MultiplicativeOrder.html Wolfram Language documentation]
  5. [https://rosettacode.org/wiki/Multiplicative_order rosettacode.org - examples of multiplicative order in various languages]
Info: Wikipedia Source

This article was imported from Wikipedia and is available under the Creative Commons Attribution-ShareAlike 4.0 License. Content has been adapted to SurfDoc format. Original contributors can be found on the article history page.

Want to explore this topic further?

Ask Mako anything about Multiplicative order — get instant answers, deeper analysis, and related topics.

Research with Mako

Free with your Surf account

Content sourced from Wikipedia, available under CC BY-SA 4.0.

This content may have been generated or modified by AI. CloudSurf Software LLC is not responsible for the accuracy, completeness, or reliability of AI-generated content. Always verify important information from primary sources.

Report