# Twin Prime Sieve

1. Oct 8, 2010

### toddkuen

I am interested in twin primes and have not been able to find a simple "sieve" type function to calculate them.

I created my own. You can find it at this URL:

http://www.just-got-lucky.com/math/TwinPrimeSieve_08102010_v01.pdf

It calculates all the twins less than N.

I also wrote a Mathematica version - its listed in the PDF - so you can play with it.

Thanks
Todd

2. Oct 9, 2010

### CRGreathouse

How efficient is your sieve? How long does it take to generate the twins up to 10^10, say? (There are 27412679.)

Making a simple Eratosthenes-style sieve for twin primes is straightforward enough, but I wonder if anyone has tried to make a Bernstein-Atkin-style twin sieve. Is such a thing possible?

3. Oct 10, 2010

### toddkuen

Not very. I am more interested in this concept as opposed to actual use. My interest is in the abstraction of making the twin primes the sieve.

It goes along with the boxed prime idea I posted a while back. I make triples of three odds what is sieved in this case. But you could do it for groups of six as well in which case the 19 and 109 values come out.