AdvancedIntegerMathHarmonicNumber Method

Computes the given harmonic number.

Definition

Namespace: Meta.Numerics.Functions
Assembly: Meta.Numerics (in Meta.Numerics.dll) Version: 4.2.0+6d77d64445f7d5d91b12e331399c4362ecb25333
C#
public static double HarmonicNumber(
	int n
)

Parameters

n  Int32
The index of the harmonic number to compute, which must be non-negative.

Return Value

Double
The harmonic number Hn.

Remarks

Hn is the nth partial sum of the harmonic series.

Since the harmonic series diverges, Hn grows without bound as n increases, but it does so extremely slowly, approximately as log(n).

Exceptions

See Also