static void Main(string[] args) { uint num = Convert.ToUInt32(Console.ReadLine()); Atkin a = new Atkin(num); a.PrintLast(); }
public static ulong SumOfPrimes(ulong max) { //var answer = new Eratosthenes().TakeWhile(x => x < max).Aggregate((sum, x) => sum + x); var answer = new Atkin(max).Aggregate((sum, x) => sum + x); return(answer); }
public void GetEnumerator_FirstFiveHundredNumbers_AreCorrect() { var sequence = new Atkin(2000000); var first500ProductFound = sequence.Take(5).ToArray().Max(); Console.WriteLine(first500ProductFound+1); foreach (var VARIABLE in sequence.Take(5)) { Console.WriteLine(VARIABLE+1); } }
public void AtkinTest() { var atkin10 = new Atkin(10); Console.WriteLine(atkin10.Count()); foreach(var number in atkin10) { Console.WriteLine(number); } var atkin1000000 = new Atkin(1000000); Console.WriteLine(atkin1000000.Count()); var atkin100000000 = new Atkin(100000000); Console.WriteLine(atkin100000000.Count()); }
private static ulong BruteForce() { var primes = new Atkin(987654321); return(0); }