Special.PowerSum Method

Compute the sum of the p-th powers of the first n positive integers.

Definition

Namespace: Numerics.NET
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.1.2
C#
public static double PowerSum(
	int n,
	int p
)

Parameters

n  Int32
The number of terms.
p  Int32
The exponent.

Return Value

Double
The sum of the p-th powers of all integers from 1 to n.

Remarks

This function is also known as Faulhaber's function.

Exceptions

See Also