sieve-of-atkin

Sieve of Atkin explanation

I am doing a project at the moment and I need an efficient method for calculating prime numbers. I have used the sieve of Eratosthenes but, I have been searching around and have found that the sieve of Atkin is a more efficient method. I have found it difficult to find an explanation (that I have been able to understand!) of this method....

C#: Implementation of the Sieve of Atkin

I was wondering if someone here have a good implementation of the Sieve of Atkin that they would like to share. I am trying to implement it, but can't quite wrap my head around it. Here is what I have so far. public class Atkin : IEnumerable<ulong> { private readonly List<ulong> primes; private readonly ulong limit; publi...

C#: How to make Sieve of Atkin incremental

I don't know if this is possible or not, but I just gotta ask. My mathematical and algorithmic skills are kind of failing me here :P The thing is I now have this class that generates prime numbers up to a certain limit: public class Atkin : IEnumerable<ulong> { private readonly List<ulong> primes; private readonly ulong limit; ...

C++ Sieve of Atkin overlooks a few prime numbers

Hello All! Recently I've been working on a C++ prime generator that uses the Sieve of Atkin ( http://en.wikipedia.org/wiki/Sieve_of_atkin ) to generate its primes. My objective is to be able to generate any 32-bit number. I'll use it mostly for project euler problems. mostly it's just a summer project. The program uses a bitboard to...

Why is my implementation of the Sieve of Atkin overlooking numbers close to the specified limit?

My implementation of Sieve of Atkin either overlooks primes near the limit or composites near the limit. while some limits work and others don't. I'm am completely confused as to what is wrong. def AtkinSieve (limit): results = [2,3,5] sieve = [False]*limit factor = int(math.sqrt(lim)) for i in range(1,factor): for j in range(1, fac...