private static long FindMostPrimes() { var ff = new FactorFactory(); long numberOfPrimes; long mostSoFar = 0; int resultA; int resultB; long product = -1; for (int a = -999; a < 1000; a++) { for (int b = -1000; b <= 2000; b++) { numberOfPrimes = ff.MaxQuadPrime(a, b); if (numberOfPrimes > mostSoFar) { mostSoFar = numberOfPrimes; resultA = a; resultB = b; product = a * b; } } } return(product); }
private static void FactorFinder() { var ff = new FactorFactory(); long[][] primes = new long[MAXVAL - MINVAL + 1][]; for (long i = MINVAL; i <= MAXVAL; i++) { var res = ff.AllFactor(i); primes[i - MINVAL] = res; } PrintResults(primes); }
private static bool IsPrime(long number) { var ff = new FactorFactory(); return(ff.IsPrime(number)); }