# 求和

**求和**是把一列数或其他项相加，产生一个称为和的总量的运算。在初等算术中，它就是加法运算：把数合并起来得到一个和，被合并的数称为加数。<sup>[1](https://openstax.org/books/prealgebra/pages/1-2-add-whole-numbers?modal=MH)</sup> 在高等数学中，这个词还指系统地相加一个数列的各项——可用求和记法紧凑地写出——以及指在计算机上精确相加许多值的数值问题。

| 关键事实 | 细节 |
|---|---|
| 记法 | 求和记法，常称西格玛记法，使用希腊大写字母 Σ，并给出各项的显式公式、Σ 下方的求和指标以及求和的上下限<sup>[2](https://openstax.org/books/algebra-and-trigonometry-2e/pages/13-4-series-and-their-notations)</sup> |
| 符号起源 | 莱昂哈德·欧拉（Leonhard Euler）于1755年引入用于求和的西格玛记法；此前大写 S 已普遍用于表示和<sup>[3](https://www.math.uni.edu/~campbell/mdm/Sigma.html)</sup> |
| 部分和 | 级数的第 n 个部分和是从首项开始的有限个连续项之和，记作 \( S_n \)<sup>[2](https://openstax.org/books/algebra-and-trigonometry-2e/pages/13-4-series-and-their-notations)</sup> |
| 无限几何级数 | 当公比满足 \( -1 < r < 1 \) 时，无限几何级数的和才有定义<sup>[2](https://openstax.org/books/algebra-and-trigonometry-2e/pages/13-4-series-and-their-notations)</sup> |
| 浮点误差 | 对于 \( n \) 个浮点数，成对求和的误差常数为 \( \log_2 n \)，补偿求和的误差常数为常数量级，而朴素递归求和的常数更大<sup>[4](https://nhigham.com/wp-content/uploads/2023/10/high93s.pdf)</sup> |
| 实用算法 | NumPy 的 `sum` 使用部分成对求和，Python 的 `math.fsum` 较慢但更精确，卡汉（Kahan）补偿求和是第三种选择<sup>[5](https://www.math.cmu.edu/~gautam/c/2024-387/notes/code/compensated-summation.html)</sup> |

## 加法的基本性质

非负整数的加法遵循一些规则，这些规则可沿用到一切形式的求和。交换律指出，改变加数的顺序不改变和，因此 \( a + b = b + a \)。恒等性质指出，任何数与零的和都是该数本身。<sup>[1](https://openstax.org/books/prealgebra/pages/1-2-add-whole-numbers?modal=MH)</sup> 这些性质意味着，多项之和可以重新分组、重新排序而不改变其精确值；在计算机算术中，这一点变得重要，有时也不再成立。

## 西格玛记法

数列各项之和称为级数。求和记法可紧凑地表示级数：前 \( n \) 项之和写作

\[ \sum_{k=1}^{n} a_k \]

其中 \( k \) 是求和指标，1 是求和下限，\( n \) 是上限。下限不必为 1；它可以是任何数，不过 1 经常被使用。要计算这样的和，把 \( k \) 从下限到上限的每个值代入 \( a_k \) 的公式，再将结果相加。例如，\( \sum_{k=3}^{7} k^2 = 9 + 16 + 25 + 36 + 49 = 135 \)。<sup>[2](https://openstax.org/books/algebra-and-trigonometry-2e/pages/13-4-series-and-their-notations)</sup>

西格玛记法遵循可简化计算的代数规则。常数因子可以提到求和号外：\( \sum_{i=1}^{n} c a_i = c \sum_{i=1}^{n} a_i \)，因为 \( c a_1 + c a_2 + \cdots + c a_n = c(a_1 + a_2 + \cdots + a_n) \)。<sup>[6](https://openstax.org/books/calculus-volume-2/pages/1-1-approximating-areas)</sup> 在用黎曼和（Riemann sums）近似面积以及一般地处理级数时，这类性质被常规使用。

## 有限级数与无限级数

级数的第 n 个部分和记作 \( S_n \)，是从首项开始的有限个连续项之和。对于级数 \( 3 + 7 + 11 + 15 + 19 + \cdots \)，部分和为 \( S_1 = 3 \)、\( S_2 = 10 \)、\( S_3 = 21 \)、\( S_4 = 36 \)。<sup>[2](https://openstax.org/books/algebra-and-trigonometry-2e/pages/13-4-series-and-their-notations)</sup> 对于算术级数，其相邻项相差常数 \( d \)，可以正着写和、倒着写和，再把两式相加，从而得到前 \( n \) 项之和的闭式公式。<sup>[2](https://openstax.org/books/algebra-and-trigonometry-2e/pages/13-4-series-and-their-notations)</sup>

无限级数对项进行无休止的求和，其和可能存在也可能不存在。如果各项不趋于零，部分和会无界增长，级数发散；级数 \( \sum_{k=1}^{\infty} 2k \) 就是一例。<sup>[2](https://openstax.org/books/algebra-and-trigonometry-2e/pages/13-4-series-and-their-notations)</sup> 对于几何级数，其中每一项都是前一项的固定倍数 \( r \)，其和恰在 \( -1 < r < 1 \) 时有定义。在这种情况下，随着 \( n \) 增大，部分和趋近一个有限极限，可由部分和公式 \( S_n = \frac{a_1(1 - r^n)}{1 - r} \) 算出；例如，\( a_1 = 248.6 \)、\( r = 0.4 \) 的级数之和为 \( \frac{248.6}{1 - 0.4} = 414.\overline{3} \)。<sup>[2](https://openstax.org/books/algebra-and-trigonometry-2e/pages/13-4-series-and-their-notations)</sup>

## 历史

对量进行相加早于书面记法。来自非洲刚果地区的伊尚戈骨（Ishango bone）上有数十道平行刻痕，表明人们至少在两万年前就在进行刻记，这是一种记录计数的方式。<sup>[7](https://www.livescience.com/physics-mathematics/mathematics/when-was-math-invented)</sup> 古代苏美尔人（Sumerians）发展出包括乘除法表在内的算术概念；圣劳伦斯大学（St. Lawrence University）数学家邓肯·梅尔维尔（Duncan Melville）将这项工作与一个不断扩大的官僚体系的需要联系起来：该体系的记录员必须追踪进出仓库的物品。<sup>[7](https://www.livescience.com/physics-mathematics/mathematics/when-was-math-invented)</sup>

埃及人的计算从根本上说是加法性的。最频繁的运算有翻倍（即把一个数与自身相加）以及减半；书吏通过反复翻倍和相加来构造乘法，如莱因德纸草书（Rhind Papyrus）中的问题所示。<sup>[8](https://www.open.edu/openlearn/science-maths-technology/mathematics-statistics/egyptian-mathematics/content-section-1.1.2)</sup> 现代符号体系出现得晚得多。加号和减号最早出现在约翰内斯·维德曼（Johannes Widman）1489年的莱比锡商业算术书中，最初表示商业问题中的盈余与亏空，而不是运算。<sup>[9](https://mathshistory.st-andrews.ac.uk//Miller/mathsym/operation/)</sup> 用于求和的西格玛符号由莱昂哈德·欧拉于1755年引入；欧拉此前引入过 \( e \)、\( \pi \) 和 \( i \)，而戈特弗里德·威廉·莱布尼茨（Gottfried Wilhelm Leibniz）曾用拉长的 S 表示求和与积分。<sup>[3](https://www.math.uni.edu/~campbell/mdm/Sigma.html)</sup>

## 浮点算术中的求和

在计算机上，相加的顺序很重要。浮点加法不满足结合律，因此由于中间舍入，\( (a+b)+c \) 与 \( a+(b+c) \) 可能不同；假定浮点算术服从普通代数定律可能导致数值误差。<sup>[10](https://arxiv.org/abs/2005.05387)</sup> 尼古拉斯·J. 海厄姆（Nicholas J. Higham）当时是曼彻斯特大学（University of Manchester）的数值分析学家，他1993年发表于 SIAM（工业与应用数学学会）的论文是该主题的标准参考文献；他分析了五种求和方法及其变体，发现没有一种方法在所有情况下都更精确，尽管针对特定情形已有一些准则。<sup>[11](https://epubs.siam.org/doi/10.1137/0914050)</sup>

有几种算法优于朴素从左到右累加。对于非常大的 \( n \)，成对求和递归地把列表分成两半相加，其误差常数为 \( \log_2 n \)，补偿求和的误差常数为常数量级；成对求和也很适合并行计算。<sup>[4](https://nhigham.com/wp-content/uploads/2023/10/high93s.pdf)</sup> 卡汉求和算法（Kahan summation algorithm），又称补偿求和，维护一个持续更新的修正项，用来找回每次加法中丢失的低位比特，并显著降低总和的数值误差。<sup>[12](https://wp.up.pt/pcandeiastst/wp-content/uploads/sites/303/2022/02/LivroResumos2014.pdf)</sup> 2021年对确定性与概率性误差界的一项分析发现，在三类算法中，补偿求和通常最精确。<sup>[13](https://arxiv.org/abs/2107.01604)</sup>

这些方法在日常中都有使用。NumPy 的 `sum` 使用部分成对求和算法，速度快且比直接顺序求和更精确；Python 标准的 `math.fsum` 较慢但更精确；补偿求和还可作为进一步的选择。<sup>[5](https://www.math.cmu.edu/~gautam/c/2024-387/notes/code/compensated-summation.html)</sup> 在科学计算中，这一选择很重要，因为在计算内积、均值、方差、范数以及许多非线性函数时都会出现浮点数求和。<sup>[4](https://nhigham.com/wp-content/uploads/2023/10/high93s.pdf)</sup>

## 相关求和公式

除初等情形与几何情形之外，数学还发展出用于加速或变换求和的公式。美国国家标准与技术研究院（NIST）的数学函数数字图书馆（Digital Library of Mathematical Functions）在伯努利（Bernoulli）多项式与欧拉多项式的应用中收录了欧拉–麦克劳林求和公式（Euler–Maclaurin summation formula）和布尔求和公式（Boole summation formula）；布尔公式用欧拉多项式、\( f \) 的导数的边界值以及一个余项来表示交错和 \( \sum_{j=a}^{n-1} (-1)^j f(j+h) \)。<sup>[14](https://dlmf.nist.gov/24.17)</sup> 这类公式把离散求和与积分联系起来，并贯穿于特殊函数理论之中。

## References

1. [1.2 Add Whole Numbers, OpenStax Prealgebra](https://openstax.org/books/prealgebra/pages/1-2-add-whole-numbers?modal=MH)
2. [13.4 Series and Their Notations, OpenStax Algebra and Trigonometry 2e](https://openstax.org/books/algebra-and-trigonometry-2e/pages/13-4-series-and-their-notations)
3. [Summation notation, University of Northern Iowa (G. D. Campbell)](https://www.math.uni.edu/~campbell/mdm/Sigma.html)
4. [Nicholas J. Higham (1993). The Accuracy of Floating Point Summation, SIAM J. Sci. Comput. 14(4), 783–799](https://nhigham.com/wp-content/uploads/2023/10/high93s.pdf)
5. [Compensated summation notes, Carnegie Mellon University](https://www.math.cmu.edu/~gautam/c/2024-387/notes/code/compensated-summation.html)
6. [1.1 Approximating Areas, OpenStax Calculus Volume 2](https://openstax.org/books/calculus-volume-2/pages/1-1-approximating-areas)
7. [When was math invented?, Live Science (2025)](https://www.livescience.com/physics-mathematics/mathematics/when-was-math-invented)
8. [Egyptian mathematics: 1.1.2 Egyptian calculation, OpenLearn, The Open University](https://www.open.edu/openlearn/science-maths-technology/mathematics-statistics/egyptian-mathematics/content-section-1.1.2)
9. [Earliest Uses of Symbols of Operation, MacTutor History of Mathematics](https://mathshistory.st-andrews.ac.uk//Miller/mathsym/operation/)
10. [Computationally Inequivalent Summations and Their Parenthetic Forms, arXiv:2005.05387](https://arxiv.org/abs/2005.05387)
11. [The Accuracy of Floating Point Summation, SIAM Journal on Scientific Computing](https://epubs.siam.org/doi/10.1137/0914050)
12. [An example of a summation error and ways of dealing with it (conference abstracts, University of Porto)](https://wp.up.pt/pcandeiastst/wp-content/uploads/sites/303/2022/02/LivroResumos2014.pdf)
13. [Deterministic and Probabilistic Error Bounds for Floating Point Summation Algorithms, arXiv:2107.01604](https://arxiv.org/abs/2107.01604)
14. [DLMF §24.17 Mathematical Applications, NIST Digital Library of Mathematical Functions](https://dlmf.nist.gov/24.17)

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

Topic: 物质世界与数学 › 数学与统计学 › 数与代数 › Arithmetic and number systems › Elementary and formal arithmetic › Elementary arithmetic operations

Copyright 2026 Edgepedia

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

Source: https://www.edgepedia.org/zh/summation

English original: https://www.edgepedia.org/summation
