Special.Power Sum 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#
The sum of the p-th powers of all integers from 1 to n.
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.1.2
public static double PowerSum(
int n,
int p
)
Parameters
Return Value
DoubleThe sum of the p-th powers of all integers from 1 to n.
Remarks
This function is also known as Faulhaber's function.
Exceptions
Argument | p is less than 0. |