public ulong SumPrimes(ulong maxValue) { var primeList = new PrimeList().Get(); ulong sum = 0; foreach (var prime in primeList) { if (prime >= maxValue) { break; } sum += prime; } return(sum); }
public ulong GetPrime(int i) { var primeList = new PrimeList().Get(); return(primeList.Skip(i - 1).First()); }