# 奇偶性（数学）

在数学中，奇偶性是整数为偶数或奇数的性质：一个整数能被2整除时是偶数，否则是奇数。形式化地说，非负整数 n 若满足 n mod 2 = 0 则为偶数，若 n mod 2 = 1 则为奇数，而 n 的奇偶性就是它的奇性或偶性<sup>[1](https://www.cs.carleton.edu/faculty/dln/book/ch02_basic-data-types_2021_September_08.pdf)</sup>。换言之，整数 x 为偶数当且仅当 x ≡ 0 (mod 2)，为奇数当且仅当 x ≡ 1 (mod 2)，而两个整数 x 与 y 具有相同的奇偶性当且仅当 x ≡ y (mod 2)<sup>[2](https://publish.uwo.ca/~mfranc65/ENT.pdf)</sup>。这个词也推广到其他被分为两类的对象，例如偶排列与奇排列，或偶函数与奇函数。

| 关键事实 | 详情 |
|---|---|
| 定义 | 若 n mod 2 = 0 则 n 为偶数，若 n mod 2 = 1 则为奇数；奇偶性即 n 的奇性或偶性<sup>[1](https://www.cs.carleton.edu/faculty/dln/book/ch02_basic-data-types_2021_September_08.pdf)</sup> |
| 同余形式 | x 为偶数当且仅当 x ≡ 0 (mod 2)；x 与 y 奇偶性相同当且仅当 x ≡ y (mod 2)<sup>[2](https://publish.uwo.ca/~mfranc65/ENT.pdf)</sup> |
| 算术规则 | 偶数与奇数之和总是奇数；偶数与奇数之积总是偶数<sup>[3](https://link.springer.com/chapter/10.1007/978-3-030-61570-3_11)</sup><sup> • </sup><sup>[4](https://mathworld.wolfram.com/EvenNumber.html)</sup> |
| 图论 | 顶点度数之和等于 2·\|E\|，因此每个图都有偶数个奇度顶点<sup>[5](https://people.math.carleton.ca/~kcheung/math/books/giam-ON/html/sec-parity.html)</sup> |
| 排列 | 排列按其逆序对数的奇偶性分为偶排列或奇排列；sign(π) = (−1) 的该数次幂<sup>[6](https://math.libretexts.org/Bookshelves/Linear_Algebra/Book%3A_Linear_Algebra_%28Schilling_Nachtergaele_and_Lankham%29/08%3A_Permutations_and_the_Determinant/8.01%3A_Permutations)</sup> |
| 计算 | 单个奇偶校验位能检测任意奇数个比特错误，但检测不出偶数个错误，也无法定位错误<sup>[7](https://users.ece.cmu.edu/~koopman/des_s99/coding/)</sup> |
| 筛法理论 | 奇偶性问题由塞尔伯格首次明确提出，通常使筛法无法区分具有奇数个与偶数个素因子的数<sup>[8](https://terrytao.wordpress.com/2015/01/21/254a-notes-4-some-sieve-theory/)</sup> |

## 定义与算术

奇偶性将整数划分为模 2 的两个剩余类。在模 2 的整数中，类 [0] 是偶数，类 [1] 是奇数<sup>[9](https://cs.yale.edu/homes/aspnes/pinewiki/NumberTheory.html)</sup>。由于加 1 会切换所在类，每个整数恰好是偶数或奇数之一，而这两个类在算术下按固定模式封闭：偶加偶与奇加奇为偶，偶加奇为奇，任何含有偶数因子的乘积为偶。偶数与奇数之和总是奇数<sup>[3](https://link.springer.com/chapter/10.1007/978-3-030-61570-3_11)</sup>，偶数与奇数之积总是偶数，因为 (2k)(2l + 1) = 2[k(2l + 1)]<sup>[4](https://mathworld.wolfram.com/EvenNumber.html)</sup>。

这些规则使奇偶性成为一种廉价的不变量。加上一个偶数不改变奇偶性，乘以一个偶数则强制结果为偶数，因此许多问题都归结为追踪一个比特的信息。在二进制算术中，这种联系是直接的：n 的最低有效位恰好就是 n mod 2，而两个布尔值的异或有时被称为奇偶函数，因为 p + q 为奇数当且仅当 p ⊕ q 为真<sup>[1](https://www.cs.carleton.edu/faculty/dln/book/ch02_basic-data-types_2021_September_08.pdf)</sup>。

## 历史

奇数与偶数的区分是数学中最古老的思想之一。毕达哥拉斯学派已经意识到这一对立，并将奇数称为磬折形数；在约公元前 425 年的一则残篇中，菲洛劳斯描述了两类特殊的数——奇数与偶数，以及两者混合时产生的第三类——偶奇数<sup>[10](https://mathshistory.st-andrews.ac.uk/Miller/mathword/o/)</sup>。亚里士多德记载，毕达哥拉斯学派认为奇数与偶数是数的元素，而他们的十对对立表将奇与偶列在第二位，仅次于有限与无限<sup>[11](https://plato.stanford.edu/archives/fall2006/entries/pythagoreanism/)</sup>。

在第七卷中，欧几里得的《几何原本》为这些思想给出了精确的定义：一个数能被分成两个相等的部分时算作偶数，不能这样分时，或与某个偶数相差一个单位时，算作奇数<sup>[12](https://www.perseus.tufts.edu/hopper/text?doc=Euc.+7&fromdoc=Perseus%3Atext%3A1999.01.0086)</sup>。历史学家 O. 贝克尔与 B. L. 范德瓦尔登指出，欧几里得关于奇偶区分的整套定理与证明都取自毕达哥拉斯学派，反映了他们对完全数的兴趣<sup>[13](https://mathshistory.st-andrews.ac.uk/DSB/Pythagoras.pdf)</sup>。第九卷开篇关于偶数与奇数的命题不依赖任何其他命题，因此它们可能是《几何原本》中最古老的部分<sup>[14](https://www.euclids-elements.org/elements/books/bookIX/propositions/propIX21/)</sup>。

## 证明中的奇偶性

奇偶性论证是组合数学中的一种标准证明技巧，因为一个被迫同时为偶数和奇数的量不可能存在。握手引理是经典例子：在无向图中，各顶点度数之和将每条边恰好计算两次，因此 \( \sum_{v \in V(G)} \deg(v) = 2 \cdot |E(G)| \)，是一个偶数<sup>[5](https://people.math.carleton.ca/~kcheung/math/books/giam-ON/html/sec-parity.html)</sup>。由此可知每个图都有偶数个奇度节点<sup>[5](https://people.math.carleton.ca/~kcheung/math/books/giam-ON/html/sec-parity.html)</sup>，这排除了例如恰好只有一个顶点度数为奇数的图。

**铺砌论证。** 棋盘的骨牌铺砌提供了第二类例子。m × n 棋盘的完美铺砌要求方格数为偶数，因为每块骨牌覆盖两个方格，所以两个维度都为奇数的棋盘无法铺砌<sup>[5](https://people.math.carleton.ca/~kcheung/math/books/giam-ON/html/sec-parity.html)</sup>。更精细的论证使用黑白交替染色，这是一种人为的奇偶性，使适当编号的方格在两种颜色间交替：奇数乘奇数的棋盘上一种颜色的方格多于另一种，这解释了为什么去掉两个对角处方格的 8 × 8 棋盘虽然方格数为偶数却无法铺砌<sup>[5](https://people.math.carleton.ca/~kcheung/math/books/giam-ON/html/sec-parity.html)</sup>。

## 排列与函数的奇偶性

“奇偶性”一词在其他几种情形中也指一种二元分类。{1, …, n} 的一个排列按其逆序对——即满足 i < j 但 π(i) > π(j) 的数对 (i, j)——的数目之奇偶性分为偶排列或奇排列；符号定义为 \( \operatorname{sign}(\pi) = (-1)^{\pi\text{ 中逆序对的数目}} \)，偶排列为 +1，奇排列为 −1<sup>[6](https://math.libretexts.org/Bookshelves/Linear_Algebra/Book%3A_Linear_Algebra_%28Schilling_Nachtergaele_and_Lankham%29/08%3A_Permutations_and_the_Determinant/8.01%3A_Permutations)</sup>。奇偶性定理指出，无论偶排列（相应地，奇排列）如何表示成对换的复合，对换的个数必为偶数（相应地，奇数），因此无论怎样分解排列，奇偶性都是良定义的<sup>[15](https://gubner.ece.wisc.edu/notes/PermutationsAndDeterminants.pdf)</sup>。这一奇偶性决定了行列式定义中的符号<sup>[15](https://gubner.ece.wisc.edu/notes/PermutationsAndDeterminants.pdf)</sup>。

实函数也有相关的一套说法。若对其定义域中每个 x 都有 f(−x) = f(x)，则函数 f 为偶函数；若 f(−x) = −f(x)，则为奇函数；偶函数的图像关于 y 轴对称，奇函数的图像关于原点对称<sup>[16](https://math.libretexts.org/Courses/Cosumnes_River_College/Corequisite_Codex/10%3A_Graphing_Functions/10.02%3A_Symmetry)</sup>。对多项式而言，这一分类可直接从指数读出：f 为偶函数当且仅当每一项的次数都是偶数，为奇函数当且仅当每一项的次数都是奇数，而既是偶函数又是奇函数的唯一函数是零函数<sup>[16](https://math.libretexts.org/Courses/Cosumnes_River_College/Corequisite_Codex/10%3A_Graphing_Functions/10.02%3A_Symmetry)</sup>。

## 计算中的奇偶性

一个二进制字的奇偶性——若其中 1 的个数为偶数则为 0，否则为 1——是最简单的检错码的基础。在 n 位字后附加一个奇偶校验位，使码字具有偶（或奇）奇偶性；在接收端，对所有接收位取异或即可揭示 1 的个数是否仍具有所需奇偶性<sup>[7](https://users.ece.cmu.edu/~koopman/des_s99/coding/)</sup>。该方案能检测任意奇数个比特错误，但检测不出偶数个错误，因为偶数次翻转会恢复原来的奇偶性；它也无法确定哪一位出错，因此没有纠错能力<sup>[7](https://users.ece.cmu.edu/~koopman/des_s99/coding/)</sup>。将数据按行和列排列并为每行每列设置一个奇偶校验位，可得到一种能定位并纠正单个比特错误的二维方案<sup>[17](https://ocw.mit.edu/courses/6-004-computation-structures-spring-2009/4d87494dc64eccf18d9e767059f32cc4_MIT6_004s09_tutor01_sol.pdf)</sup>，而理查德·汉明在 1950 年论文《检错与纠错码》中提出的汉明码，每四个信息位增加三个校验位，从而能精确定位任意单个错误<sup>[18](https://cs.stanford.edu/people/eroberts/courses/soco/projects/information-theory/error_checking_8.html)</sup>。

另一种奇偶性附着于二进制表示本身：整数 n 的奇偶性可定义为其二进制展开中 1 的个数模 2。对 n = 0, 1, 2, … 得到的序列是 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, …，即图厄-莫尔斯序列<sup>[19](https://mathworld.wolfram.com/Thue-MorseSequence.html)</sup>，它出现在字上组合学以及与数字和函数相关的乘积恒等式中。

## 筛法理论中的奇偶性问题

在解析数论中，奇偶性指的不是一种分类，而是一种根本性的局限。筛法估计一个序列中有多少整数在去掉小素数的倍数后留存下来，理想情况下它们能借此检测素数。奇偶性问题是指筛法理论通常无法区分具有奇数个素因子的整数与具有偶数个素因子的整数这一现象。<sup>[20](https://terrytao.wordpress.com/wp-content/uploads/2008/05/whatsnew_onlineversion.pdf)</sup> 加州大学洛杉矶分校的数学家陶哲轩（Terence Tao）将奇偶性障碍描述为一个令人信服的启发式论断，它由阿特勒·塞尔伯格（Atle Selberg）首次明确提出，解释了为何筛法难以给出涉及素数的计数的下界，以及为何筛法理论方法迄今未能完全解决四个朗道问题中的任何一个，包括孪生素数猜想<sup>[8](https://terrytao.wordpress.com/2015/01/21/254a-notes-4-some-sieve-theory/)</sup>。

在特定情形下，通过加入非筛法信息可以打破这一障碍。约翰·弗里德兰德（John Friedlander）与亨里克·伊万涅茨（Henryk Iwaniec）发展了一种筛法，在经典表述中加入一条额外公理，从而打破奇偶性问题，得以在稀疏序列中检测素数；他们将其应用于形如 a² + b⁴ 的素数<sup>[20](https://arxiv.org/abs/math/9811186)</sup>。D. R. 希思-布朗（D. R. Heath-Brown）1982 年的论文《筛法理论中的一个奇偶性问题》处理了同一障碍<sup>[21](https://londmathsoc.onlinelibrary.wiley.com/doi/pdf/10.1112/S0025579300012109)</sup>，2024 年凯文·福特（Kevin Ford）与詹姆斯·梅纳德（James Maynard）基于第一类与第二类估计建立了一个一般框架，用于判定何时素数加权和 \( \sum_p a_p \) 的渐近式是有保证的，从而阐明了奇偶性障碍何时可以被克服<sup>[22](https://arxiv.org/abs/2407.14368)</sup>。

## References

1. David Liben-Nowell, *Connecting Discrete Mathematics and Computer Science*, Chapter 2 preprint (Cambridge University Press). https://www.cs.carleton.edu/faculty/dln/book/ch02_basic-data-types_2021_September_08.pdf
2. *Elementary Number Theory* course notes, University of Western Ontario. https://publish.uwo.ca/~mfranc65/ENT.pdf
3. Operative Proofs in School Mathematics and Elementary Mathematics, Springer. https://link.springer.com/chapter/10.1007/978-3-030-61570-3_11
4. Even Number, Wolfram MathWorld. https://mathworld.wolfram.com/EvenNumber.html
5. *A Gentle Introduction to the Art of Mathematics*, Chapter 7: Parity and Counting Arguments. https://people.math.carleton.ca/~kcheung/math/books/giam-ON/html/sec-parity.html
6. Permutations, LibreTexts Linear Algebra. https://math.libretexts.org/Bookshelves/Linear_Algebra/Book%3A_Linear_Algebra_%28Schilling_Nachtergaele_and_Lankham%29/08%3A_Permutations_and_the_Determinant/8.01%3A_Permutations
7. Coding for Error Detection and Correction, Carnegie Mellon University (Koopman). https://users.ece.cmu.edu/~koopman/des_s99/coding/
8. Terence Tao, 254A Notes 4: Some sieve theory (2015). https://terrytao.wordpress.com/2015/01/21/254a-notes-4-some-sieve-theory/
9. Number Theory, Yale University (Aspnes). https://cs.yale.edu/homes/aspnes/pinewiki/NumberTheory.html
10. ODD NUMBER and EVEN NUMBER, Earliest Known Uses of Some of the Words of Mathematics, MacTutor. https://mathshistory.st-andrews.ac.uk/Miller/mathword/o/
11. Pythagoreanism, Stanford Encyclopedia of Philosophy. https://plato.stanford.edu/archives/fall2006/entries/pythagoreanism/
12. Euclid, *Elements*, Book VII, Perseus Digital Library. https://www.perseus.tufts.edu/hopper/text?doc=Euc.+7&fromdoc=Perseus%3Atext%3A1999.01.0086
13. Pythagoras, Dictionary of Scientific Biography, MacTutor. https://mathshistory.st-andrews.ac.uk/DSB/Pythagoras.pdf
14. Euclid's Elements, Proposition IX.21. https://www.euclids-elements.org/elements/books/bookIX/propositions/propIX21/
15. John A. Gubner, Permutations, the Parity Theorem, and Determinants, University of Wisconsin–Madison. https://gubner.ece.wisc.edu/notes/PermutationsAndDeterminants.pdf
16. Symmetry, LibreTexts Corequisite Codex. https://math.libretexts.org/Courses/Cosumnes_River_College/Corequisite_Codex/10%3A_Graphing_Functions/10.02%3A_Symmetry
17. MIT 6.004 Computation Structures, tutorial solutions. https://ocw.mit.edu/courses/6-004-computation-structures-spring-2009/4d87494dc64eccf18d9e767059f32cc4_MIT6_004s09_tutor01_sol.pdf
18. Bits and Binary Digits: Error Checking, Stanford University. https://cs.stanford.edu/people/eroberts/courses/soco/projects/information-theory/error_checking_8.html
19. Thue-Morse Sequence, Wolfram MathWorld. https://mathworld.wolfram.com/Thue-MorseSequence.html
20. John Friedlander, Henryk Iwaniec, Asymptotic sieve for primes, arXiv:math/9811186. https://arxiv.org/abs/math/9811186
21. D. R. Heath-Brown, A parity problem from sieve theory, *Mathematika* 29 (1982), 1–6. https://londmathsoc.onlinelibrary.wiley.com/doi/pdf/10.1112/S0025579300012109
22. Kevin Ford, James Maynard, On the theory of prime producing sieves, arXiv:2407.14368 (2024). https://arxiv.org/abs/2407.14368

---
*Initially written Sep 17, 2026 · Reviewed: Oct 15, 2026 · Edited: Oct 15, 2026 · Last review: Oct 15, 2026*

Topic: 物质世界与数学 › 数学与统计学 › 数与代数 › Number theory › Elementary number theory › Congruences and modular arithmetic

Copyright 2026 Edgepedia

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

Source: https://www.edgepedia.org/zh/parity-mathematics

English original: https://www.edgepedia.org/parity-mathematics
