コード例 #1
0
ファイル: Problem10.cs プロジェクト: Saragis/ProjectEuler
        public static string Solve()
        {
            const Int64 MaxValue = 2000000;

            var ps = new PrimeSieve(MaxValue);

            return ps.Primes.Sum().ToString();
        }
コード例 #2
0
ファイル: Problem35.cs プロジェクト: Saragis/ProjectEuler
        public static string Solve()
        {
            const Int64 MaxValue = 1000000;

            ps = new PrimeSieve(MaxValue);

            var circularPrimes = 0;

            foreach (var prime in ps.Primes)
                if (IsCircularPrime(prime))
                    circularPrimes++;

            return circularPrimes.ToString();
        }
コード例 #3
0
ファイル: Problem7.cs プロジェクト: Saragis/ProjectEuler
        public static string Solve()
        {
            var ps = new PrimeSieve(150000);

            return ps.GetPrime(10001).ToString();
        }