调和数定义
调和数(Harmonic Number)是一个数列,通常表示为 \( H_n \),即前 \( n \) 个自然数的倒数之和。调和数的定义是:
\( H_n = 1 + \frac{1}{2} + \frac{1}{3} + \cdots + \frac{1}{n} \)
调和数是一个逐渐增长的数列,随着 \( n \) 的增加,调和数趋于无穷大,但增幅会越来越小。调和数的应用广泛,特别是在物理学、计算机科学和数学中的许多领域。
如何计算第 N 个调和数
计算第 \( n \) 个调和数 \( H_n \) 非常简单,直接将从 \( 1 \) 到 \( n \) 的所有倒数加起来即可。其通用公式为:
\( H_n = \sum_{k=1}^{n} \frac{1}{k} \)
可以通过递归、迭代或直接计算来求得调和数。
示例
例子 1:计算第 5 个调和数
解答:
\( H_5 = 1 + \frac{1}{2} + \frac{1}{3} + \frac{1}{4} + \frac{1}{5} = 2.2833333 \)
例子 2:计算第 10 个调和数
解答:
\( H_{10} = 1 + \frac{1}{2} + \frac{1}{3} + \frac{1}{4} + \frac{1}{5} + \frac{1}{6} + \frac{1}{7} + \frac{1}{8} + \frac{1}{9} + \frac{1}{10} = 2.929 \)
例子 3:计算第 20 个调和数
解答:
\( H_{20} = 1 + \frac{1}{2} + \frac{1}{3} + \frac{1}{4} + \frac{1}{5} + \frac{1}{6} + \frac{1}{7} + \frac{1}{8} + \frac{1}{9} + \frac{1}{10} + \frac{1}{11} + \frac{1}{12} + \frac{1}{13} + \frac{1}{14} + \frac{1}{15} + \frac{1}{16} + \frac{1}{17} + \frac{1}{18} + \frac{1}{19} + \frac{1}{20} = 3.5977 \)
前 100 个调和数
- H1 = 1
- H2 = 1.5
- H3 = 1.83333
- H4 = 2.08333
- H5 = 2.28333
- H6 = 2.45
- H7 = 2.59286
- H8 = 2.71786
- H9 = 2.82897
- H10 = 2.92897
- H11 = 3.01988
- H12 = 3.10321
- H13 = 3.18013
- H14 = 3.25156
- H15 = 3.31823
- H16 = 3.38073
- H17 = 3.43955
- H18 = 3.49511
- H19 = 3.54774
- H20 = 3.59774
- H21 = 3.64536
- H22 = 3.69081
- H23 = 3.73429
- H24 = 3.77596
- H25 = 3.81596
- H26 = 3.85442
- H27 = 3.89146
- H28 = 3.92717
- H29 = 3.96165
- H30 = 3.99499
- H31 = 4.02725
- H32 = 4.0585
- H33 = 4.0888
- H34 = 4.11821
- H35 = 4.14678
- H36 = 4.17456
- H37 = 4.20159
- H38 = 4.2279
- H39 = 4.25354
- H40 = 4.27854
- H41 = 4.30293
- H42 = 4.32674
- H43 = 4.35
- H44 = 4.37273
- H45 = 4.39495
- H46 = 4.41669
- H47 = 4.43796
- H48 = 4.4588
- H49 = 4.47921
- H50 = 4.49921
- H51 = 4.51881
- H52 = 4.53804
- H53 = 4.55691
- H54 = 4.57543
- H55 = 4.59361
- H56 = 4.61147
- H57 = 4.62901
- H58 = 4.64625
- H59 = 4.6632
- H60 = 4.67987
- H61 = 4.69626
- H62 = 4.71239
- H63 = 4.72827
- H64 = 4.74389
- H65 = 4.75928
- H66 = 4.77443
- H67 = 4.78935
- H68 = 4.80406
- H69 = 4.81855
- H70 = 4.83284
- H71 = 4.84692
- H72 = 4.86081
- H73 = 4.87451
- H74 = 4.88802
- H75 = 4.90136
- H76 = 4.91451
- H77 = 4.9275
- H78 = 4.94032
- H79 = 4.95298
- H80 = 4.96548
- H81 = 4.97782
- H82 = 4.99002
- H83 = 5.00207
- H84 = 5.01397
- H85 = 5.02574
- H86 = 5.03737
- H87 = 5.04886
- H88 = 5.06022
- H89 = 5.07146
- H90 = 5.08257
- H91 = 5.09356
- H92 = 5.10443
- H93 = 5.11518
- H94 = 5.12582
- H95 = 5.13635
- H96 = 5.14676
- H97 = 5.15707
- H98 = 5.16728
- H99 = 5.17738
- H100 = 5.18738