public static List <int> primeFactors(int n) { if (n < 2) { throw new ArgumentException(); } return(SmallPrimes.trialDivision(n)); }
public static bool isPrime(int n) { if (n < 2) { return(false); } foreach (int num in SmallPrimes.PRIMES) { if (0 == (n % num)) { return(n == num); } } return(SmallPrimes.millerRabinPrimeTest(n)); }