public long Run() { var maximum = 1000000 - 1; var primes = EratosthenesPrimes.GetArray(maximum); return(Enumerable.Range(2, maximum - 1) .AsParallel() .Where(n => !primes [n - 1]) .Where(p => p.GetCyrcles().All(c => !primes [c - 1])) .Count()); }
public long Run() { return(EratosthenesPrimes.Get(2000000 - 1) .Sum()); }