Special.HarmonicNumber Method

Definition

Namespace: Numerics.NET
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.1.2

Overload List

HarmonicNumber(Int32) Returns the nth Harmonic Number.
HarmonicNumber(Int32, Double) Returns the nth generalized Harmonic Number of the specified order.

HarmonicNumber(Int32)

Returns the nth Harmonic Number.
C#
public static double HarmonicNumber(
	int n
)

Parameters

n  Int32
An integer.

Return Value

Double
The nth Harmonic Number.

Remarks

The nth Harmonic Number, Hn, is the sum of the reciprocals of the integers from 1 up to n.

HarmonicNumber(Int32, Double)

Returns the nth generalized Harmonic Number of the specified order.
C#
public static double HarmonicNumber(
	int n,
	double m
)

Parameters

n  Int32
An integer.
m  Double
The order of the harmonic number.

Return Value

Double
The nth Harmonic Number of order m.

Remarks

The nth generalized Harmonic Number, H(m)n, is the sum of the reciprocals of the integers from 1 up to n raised to the power m.

See Also