コード例 #1
0
        public void Example2()
        {
            Primes p = new Primes();

            QuadricPolynominal qp = new QuadricPolynominal(-79, 1601, p);
            Assert.AreEqual(80, qp.FindLength());
        }
コード例 #2
0
        public void Example1()
        {
            Primes p = new Primes();

            QuadricPolynominal qp = new QuadricPolynominal(1, 41, p);
            Assert.AreEqual(40, qp.FindLength());
        }
コード例 #3
0
 public QuadricPolynominal(int a, int b, Primes primes)
 {
     this.a = a;
     this.b = b;
     this.primes = primes;
 }
コード例 #4
0
        static void Main(string[] args)
        {
            Primes p = new Primes();
            int max = 0;

            for (int a = -1000; a <= 1000; a++)
            {
                for (int b = -1000; b <= 1000; b++)
                {
                    QuadricPolynominal qp = new QuadricPolynominal(a, b, p);
                    int length = qp.FindLength();
                    if (length > max)
                    {
                        max = length;
                        Console.WriteLine("n2 + {0}n + {1}, length = {2}, product of coefficients = {3}", a, b, length, a * b);
                    }
                }
            }

            Console.WriteLine("Done.");
            Console.ReadKey();
        }
コード例 #5
0
 public void Is1681Prime()
 {
     Primes p = new Primes();
     double number = 1681;
     Assert.IsFalse(p.IsPrime(number));
 }