IMSL C# Numerical Library

FaureSequence.NextPrime Method 

Returns the smallest prime greater than or equal to n.

public static int NextPrime(
   int n
);

Parameters

n
An int which specifies the first number to try as a prime.

Return Value

An int which specifies a prime greater than or equal to n.

Remarks

If n is less than or equal to 2 then 2 is returned.

See Also

FaureSequence Class | Imsl.Stat Namespace