public class PrimeNumbersUtils extends Object
| Constructor and Description |
|---|
PrimeNumbersUtils() |
| Modifier and Type | Method and Description |
|---|---|
static int |
getNextPrime(int n) |
static List<Integer> |
getNPrimes(int n)
Retrieves the first n prime numbers
|
static boolean |
isPrime(int n) |
static boolean |
millerRabin32(int n) |
static List<Integer> |
runEratosthenesSieve(int upperBound) |
public static List<Integer> getNPrimes(int n)
n - a non-negative integerpublic static List<Integer> runEratosthenesSieve(int upperBound)
upperBound - upperBoundpublic static int getNextPrime(int n)
n - npublic static boolean isPrime(int n)
n - npublic static boolean millerRabin32(int n)
n - nCopyright © 2015 The University of Manchester. All Rights Reserved.