예제 #1
0
        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);
        }
예제 #2
0
        public ulong GetPrime(int i)
        {
            var primeList = new PrimeList().Get();

            return(primeList.Skip(i - 1).First());
        }