Computes a partial
sum of the (divergent) harmonic series,
S(N) = ∑n(1 ⁄ n),
for n = 1..N. As N goes to ∞, it is
S(N) = ln N + γ
where γ, the Euler-Mascheroni constant, is
γ = 0.577 215 664 901 532 86… .
The function "ln" is the natural or Napierian logarithm.
(To avoid any ambiguity, the following is suggested:
"log" for a generic, to be particularized, logarithm;
"lg", for log10, the "common logarithm";
"ln", for loge, the Napierian or natural logarithm; and
"lb", for log2, the binary logarithm.)
For reasonable computing time, it is
N := min(N, 106) (and, if "show values", 20 000).
Plots S and L' vs. n or
ln n. |
• Wikipedia: Harmonic series; Euler-Mascheroni constant.
• Weisstein, Eric W.,
"Euler-Mascheroni Constant." From MathWorld--A Wolfram Web Resource.
• Wikipedia: Napierian logarithm. Dictionary: logarithm.
(The word algorithm comes from Al-Khwarizmi, possibly from the city of
Khwarezm
or Khwarizm, etc..)
• Wikipedia; Mathematical symbols.
• 1901-12-05: Heisenberg, Werner Karl (1976-02-01). |