# 乘法阶

整数 \( a \) 模 \( n \) 的**乘法阶**，记作 \( \operatorname{ord}_n(a) \)，是使得 \( a^k \equiv 1 \pmod{n} \) 成立的最小正整数 \( k \)。它恰好当 \( a \) 与 \( n \) 互质时存在，衡量的是将 \( a \) 反复相乘并对 \( n \) 取模，需要多少步才能回到 1。<sup>[1](https://www.studocu.com/ph/document/bicol-university/mathematics/math-40520-lecture-notes-on-key-concepts-in-number-theory-fall-2022/135965080)</sup><sup> • </sup><sup>[2](https://courses.mai.liu.se/GU/TATA54/Lectures/lecture2b.pdf)</sup>

| 关键事实 | 细节 |
|---|---|
| 定义 | 满足 \( a^k \equiv 1 \pmod{n} \) 的最小正整数 \( k \)；仅当 \( \gcd(a,n) = 1 \) 时有定义<sup>[1](https://www.studocu.com/ph/document/bicol-university/mathematics/math-40520-lecture-notes-on-key-concepts-in-number-theory-fall-2022/135965080)</sup> |
| 整除性 | \( \operatorname{ord}_n(a) \) 整除 \( \varphi(n) \)，即 \( n \) 的欧拉函数值<sup>[3](https://crypto.stanford.edu/pbc/notes/numbertheory/order.html)</sup> |
| 群论含义 | \( a \) 在乘法群 \( (\mathbb{Z}/n\mathbb{Z})^\times \) 中的阶；幂 \( 1, a, \dots, a^{k-1} \) 构成由 \( a \) 生成的循环子群<sup>[4](https://math.libretexts.org/Bookshelves/Combinatorics_and_Discrete_Mathematics/Yet_Another_Introductory_Number_Theory_Textbook_-_Cryptology_Emphasis_%28Poritz%29/03%3A_Primes_Numbers/3.03%3A_Multiplicative_Order_and_Applications)</sup> |
| 原根 | 阶为 \( \varphi(n) \) 的元素；这样的生成元仅对模 \( 2, 4, p^a, 2p^a \)（\( p \) 为奇素数）存在<sup>[5](https://encyclopediaofmath.org/wiki/Primitive_root)</sup> |
| 计算 | 将 \( \varphi(n) \) 分解质因数，从 \( \varphi(n) \) 出发，对每个素因子 \( q \)，只要 \( a^{\text{阶}/q} \equiv 1 \) 就除以 \( q \)；在 \( \varphi(n) \) 已分解的前提下，代价为 \( O(\omega(\varphi(n)) \cdot \log \varphi(n)) \) 次模幂运算<sup>[6](https://stblake.github.io/mathilda/documentation/number-theory/MultiplicativeOrder/)</sup> |
| 小数循环节 | \( 1/k \) 的十进制展开中循环节的长度等于 10 模 \( k \) 的阶<sup>[7](https://primes.utm.edu/glossary/page.php?sort=PeriodOfADecimal)</sup> |
| 量子关联 | 求阶是 Shor 因数分解算法的数论核心；一个高效的求阶器通过经典归约即可得到高效的因数分解器<sup>[8](https://www.cs.cmu.edu/~odonnell/quantum15/lecture09.pdf)</sup> |

## 定义与群论背景

固定模 \( n \) 以及与 \( n \) 互质的整数 \( a \)。与 \( n \) 互质的同余类在乘法下构成一个有限群 \( (\mathbb{Z}/n\mathbb{Z})^\times \)，共有 \( \varphi(n) \) 个元素。\( a \) 模 \( n \) 的乘法阶就是它作为该群中元素的阶：满足 \( a^k \equiv 1 \pmod{n} \) 的最小 \( k > 0 \)。<sup>[1](https://www.studocu.com/ph/document/bicol-university/mathematics/math-40520-lecture-notes-on-key-concepts-in-number-theory-fall-2022/135965080)</sup><sup> • </sup><sup>[9](https://www.math.cmu.edu/users/vahagn/lecture_notes/numbertheory.pdf)</sup>

幂 \( [a], [a^2], [a^3], \dots \) 一路攀升至 \( [a^{\operatorname{ord}_n(a)}] = [1] \)，然后重复，因此集合 \( \langle a \rangle = \{[a^j] \mid j \le \operatorname{ord}_n(a)\} \) 恰好有 \( \operatorname{ord}_n(a) \) 个元素；在群论中，这个集合就是 \( (\mathbb{Z}/n\mathbb{Z})^\times \) 中由 \( a \) 生成的循环子群。<sup>[4](https://math.libretexts.org/Bookshelves/Combinatorics_and_Discrete_Mathematics/Yet_Another_Introductory_Number_Theory_Textbook_-_Cryptology_Emphasis_%28Poritz%29/03%3A_Primes_Numbers/3.03%3A_Multiplicative_Order_and_Applications)</sup> 元素的阶与它生成的子群的大小相等，而 \( a \) 的各不相同的幂恰好是 \( 1, a, \dots, a^{k-1} \)。<sup>[10](https://www.math.ucla.edu/~sharifi/notes/algebra-ch02.html)</sup>

## 基本性质

**阶整除 \( \varphi(n) \)。** 欧拉定理指出，对每个单位 \( a \) 都有 \( a^{\varphi(n)} \equiv 1 \pmod{n} \)。若 \( x \) 是 \( a \) 的阶且 \( a^y = 1 \)，欧几里得算法给出 \( d = \gcd(x,y) = mx + ny \)，于是 \( a^d = (a^x)^m (a^y)^n = 1 \)；由于 \( d \le x \) 且 \( x \) 最小，故 \( d = x \)，即 \( x \) 整除 \( y \)。取 \( y = \varphi(n) \) 即知阶整除 \( \varphi(n) \)。<sup>[3](https://crypto.stanford.edu/pbc/notes/numbertheory/order.html)</sup> 费马小定理是模为素数时的情形，即特例 \( \operatorname{ord}_p(a) \mid p - 1 \)。这些整除性命题是群论中拉格朗日定理的特例，后者说元素的阶整除群的阶。<sup>[3](https://crypto.stanford.edu/pbc/notes/numbertheory/order.html)</sup>

**乘积的阶。** 设 \( x \) 是 \( a \) 的阶，\( y \) 是 \( b \) 模 \( n \) 的阶。若 \( x \) 与 \( y \) 互质，则 \( ab \) 的阶恰为 \( xy \)：任何满足 \( (ab)^k = 1 \) 的 \( k \) 必同时是 \( x \) 和 \( y \) 的倍数，从而是 \( xy \) 的倍数，而 \( (ab)^{xy} = 1 \)。<sup>[3](https://crypto.stanford.edu/pbc/notes/numbertheory/order.html)</sup> 令 \( d = \gcd(x,y) \)，则 \( ab \) 的阶是 \( xy/d^2 \) 的倍数，且整除 \( xy/d \)，即 \( x \) 与 \( y \) 的最小公倍数。<sup>[3](https://crypto.stanford.edu/pbc/notes/numbertheory/order.html)</sup>

**生成元与原根。** 阶等于 \( \varphi(n) \) 的元素称为模 \( n \) 的原根；它的幂 \( 1, g, \dots, g^{\varphi(n)-1} \) 遍历所有缩剩余类，而满足 \( g^\gamma \equiv a \pmod{n} \) 的指数 \( \gamma \) 称为 \( a \) 的指数（离散对数）。<sup>[5](https://encyclopediaofmath.org/wiki/Primitive_root)</sup> 原根并非对每个模都存在，仅对 \( n = 2, 4, p^a, 2p^a \)（\( p \) 为奇素数）存在；在这些情形下，单位群是阶为 \( \varphi(n) \) 的循环群。<sup>[5](https://encyclopediaofmath.org/wiki/Primitive_root)</sup> 阶为 \( n \) 的循环群恰有 \( \varphi(n) \) 个生成元。<sup>[10](https://www.math.ucla.edu/~sharifi/notes/algebra-ch02.html)</sup> 模 \( n \) 下任何元素的最大阶就是卡迈克尔函数 \( \lambda(n) \) 的值，它是使得对所有单位 \( x \) 都有 \( x^{\lambda(n)} \equiv 1 \pmod{n} \) 的通用指数。<sup>[11](https://oeis.org/A002322)</sup>

## 计算阶

直接法计算 \( a \bmod n \)，\( a^2 \bmod n \)，\( a^3 \bmod n \)，依此类推直到出现 1，每一步将当前值乘以 \( a \) 并取模，而不是从头重新计算幂。<sup>[12](https://mathlesstraveled.wordpress.com/2019/02/08/finding-the-repetend-length-of-a-decimal-expansion/)</sup>

高效方法利用整除性上界。先计算 \( \varphi(n) \)，将其分解质因数，然后从 \( \varphi(n) \) 向下缩减阶：对整除 \( \varphi(n) \) 的每个不同素因子 \( q \)，只要 \( a^{\text{阶}/q} \equiv 1 \pmod{n} \)，就反复将当前候选阶除以 \( q \)。每次检验是一次模幂运算，在 \( \varphi(n) \) 已分解的前提下，整个计算需要 \( O(\omega(\varphi(n)) \cdot \log \varphi(n)) \) 次模幂运算。<sup>[6](https://stblake.github.io/mathilda/documentation/number-theory/MultiplicativeOrder/)</sup> 同样的缩减思路也出现在标准的竞赛编程实现中：从 \( \varphi(n) \) 出发，只要缩减后的指数仍将 \( a \) 送到 1，就剥去素因子。<sup>[13](https://neelmishra.github.io/blog/cp/number-theory-1/order-primitive-roots.html)</sup> 因此瓶颈在于分解 \( \varphi(n) \)，即使已知 \( n \) 的分解，这仍可能很困难，因为知道 \( n \) 的分解只能使计算 \( \varphi(n) \) 变得高效。<sup>[14](https://bukittimahtutor.com/mathematics/computational-number-theory-primitive-roots-orders-carmichael-lambda-cyclotomic-polynomials/)</sup><sup> • </sup><sup>[6](https://stblake.github.io/mathilda/documentation/number-theory/MultiplicativeOrder/)</sup>

## 应用

**循环小数。** 对于写成最简形式的有理数，其十进制展开中循环节的长度只取决于分母。当 \( x = 1/k \) 时，\( 1/k \) 的循环节长度等于 10 模 \( k \) 的阶；特别地，\( 1/k \) 的循环节长度整除 \( \varphi(k) \)，而对素数 \( p \)，\( 1/p \) 的循环节长度整除 \( p - 1 \)。<sup>[7](https://primes.utm.edu/glossary/page.php?sort=PeriodOfADecimal)</sup> 原因出现在长除法中：每一步将余数乘以 10 并对 \( p \) 取模，因此余数序列恰好经历模 \( p \) 的乘以 10 变换，经过 \( \operatorname{ord}_p(10) \) 步后循环。<sup>[15](https://math.stackexchange.com/questions/3273799/the-length-of-the-repetend-of-frac1p-is-equal-to-the-order-of-10-modulo)</sup> 例如，所有分母为 7 的分数循环节长度都是 6，即 10 模 7 的阶。<sup>[16](https://digitalcommons.unl.edu/mathfacpub/48/)</sup>

**密码学。** 在 RSA 中，从 \( a^e \pmod{N} \) 恢复消息等价于找到满足 \( de = k\varphi(N) + 1 \) 的 \( d \)，即 \( d = e^{-1} \bmod \varphi(N) \)，此后 \( (a^e)^d = a \)。目前不知道如何在不分解 \( N \) 的情况下从 \( N \) 计算 \( \varphi(N) \)，而大数分解尚无已知的高效经典方法，这正是该方案安全性的来源。<sup>[3](https://crypto.stanford.edu/pbc/notes/numbertheory/order.html)</sup>

**量子因数分解。** 求阶问题给定互质的 \( A \) 与 \( M \)，要求找出满足 \( A^s \equiv 1 \pmod{M} \) 的最小 \( s \ge 1 \)。因数分解可通过经典可执行的归约化归为求阶，因此高效的求阶器可得到高效的因数分解器。<sup>[8](https://www.cs.cmu.edu/~odonnell/quantum15/lecture09.pdf)</sup> Shor 算法恰好提供了这一点：一个量子子程序在多项式时间内求出 \( \mathbb{Z}_N^* \) 中随机选取的元素的阶，这正是它相对于已知最佳经典因数分解方法取得加速的根源。<sup>[17](https://arxiv.org/abs/quant-ph/9508027)</sup> 量子部分估计分数 \( s/r \)，其中 \( r \) 为所求的阶，经典后处理则恢复 \( r \)，进而得到因子。<sup>[18](https://arxiv.org/abs/2207.05976)</sup>

**有限域与编码。** 在有限域中，密码学和编码理论需要高乘法阶的元素，这促使人们研究域元素阶的上界与下界。<sup>[19](https://math.sun.ac.za/2019/10/21/breuer.html)</sup>

## References

1. [Definition 51, Math 40520 Lecture Notes on Key Concepts in Number Theory](https://www.studocu.com/ph/document/bicol-university/mathematics/math-40520-lecture-notes-on-key-concepts-in-number-theory-fall-2022/135965080)
2. [Jan Snellman, Number Theory, Lecture 2b: Multiplicative order, Cyclic Groups, Fermat's and Euler's theorems, Linköping University](https://courses.mai.liu.se/GU/TATA54/Lectures/lecture2b.pdf)
3. [Paul Burchard (notes), Number Theory: The Order of a Unit, Stanford](https://crypto.stanford.edu/pbc/notes/numbertheory/order.html)
4. [Multiplicative Order and Applications, Yet Another Introductory Number Theory Textbook (Poritz), Mathematics LibreTexts](https://math.libretexts.org/Bookshelves/Combinatorics_and_Discrete_Mathematics/Yet_Another_Introductory_Number_Theory_Textbook_-_Cryptology_Emphasis_%28Poritz%29/03%3A_Primes_Numbers/3.03%3A_Multiplicative_Order_and_Applications)
5. [Primitive root, Encyclopedia of Mathematics](https://encyclopediaofmath.org/wiki/Primitive_root)
6. [MultiplicativeOrder, Mathilda documentation](https://stblake.github.io/mathilda/documentation/number-theory/MultiplicativeOrder/)
7. [Period of a decimal expansion, The Prime Glossary (PrimePages)](https://primes.utm.edu/glossary/page.php?sort=PeriodOfADecimal)
8. [Ryan O'Donnell, Quantum Computation, Lecture 9: Order finding, Carnegie Mellon University](https://www.cs.cmu.edu/~odonnell/quantum15/lecture09.pdf)
9. [Vahagn Minasyan, Number Theory lecture notes, Carnegie Mellon University](https://www.math.cmu.edu/users/vahagn/lecture_notes/numbertheory.pdf)
10. [Romyar Sharifi, Abstract Algebra, Chapter 2: Group theory, UCLA](https://www.math.ucla.edu/~sharifi/notes/algebra-ch02.html)
11. [A002322: Carmichael lambda function, OEIS](https://oeis.org/A002322)
12. [Brent Yorgey, Finding the repetend length of a decimal expansion, The Math Less Traveled](https://mathlesstraveled.wordpress.com/2019/02/08/finding-the-repetend-length-of-a-decimal-expansion/)
13. [Neel Mishra, Multiplicative Order & Primitive Roots](https://neelmishra.github.io/blog/cp/number-theory-1/order-primitive-roots.html)
14. [Computational Number Theory 29: Primitive Roots, Multiplicative Orders, Carmichael λ and Cyclotomic Polynomials](https://bukittimahtutor.com/mathematics/computational-number-theory-primitive-roots-orders-carmichael-lambda-cyclotomic-polynomials/)
15. [The length of the repetend of 1/p is equal to the order of 10 modulo p, Mathematics Stack Exchange](https://math.stackexchange.com/questions/3273799/the-length-of-the-repetend-of-frac1p-is-equal-to-the-order-of-10-modulo)
16. [William G. Leavitt, "A Theorem on Repeating Decimals", The American Mathematical Monthly 74 (1967), University of Nebraska DigitalCommons](https://digitalcommons.unl.edu/mathfacpub/48/)
17. [Peter W. Shor, Polynomial-Time Algorithms for Prime Factorization and Discrete Logarithms on a Quantum Computer, arXiv:quant-ph/9508027](https://arxiv.org/abs/quant-ph/9508027)
18. [Distributed Shor's algorithm, arXiv:2207.05976](https://arxiv.org/abs/2207.05976)
19. [Florian Breuer, Multiplicative orders of elements in finite fields, Stellenbosch University mathematics colloquium](https://math.sun.ac.za/2019/10/21/breuer.html)

---
*Initially written Oct 15, 2026*

Topic: 物质世界与数学 › 数学与统计学 › 数与代数 › Number theory › Elementary number theory › Orders, primitive roots, and the multiplicative group mod n

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/multiplicative-order

English original: https://www.edgepedia.org/multiplicative-order
