Example #1
0
        public void Problem7()
        {
            var answer
                = Sequences.PrimeNumbers()
                  .Skip(10_000)
                  .First();

            Assert.That(answer, Is.EqualTo(104743));
        }
Example #2
0
        public void Problem10()
        {
            long sum = 0;

            foreach (var prime in Sequences.PrimeNumbers())
            {
                if (prime >= 2_000_000)
                {
                    break;
                }
                sum += prime;
            }

            long answer = sum;

            Assert.That(answer, Is.EqualTo(142_913_828_922));
        }