mersenneforum.org twin prime, but sieving n instead of k. Possible?
 Register FAQ Search Today's Posts Mark Forums Read

 2007-11-23, 20:58 #1 jasong     "Jason Goatcher" Mar 2005 3·7·167 Posts twin prime, but sieving n instead of k. Possible? I have someone who I trust that says that a certain k should be dense with primes based on his Number Theory research(he's working on a paper). I was wondering if there's a program to sieve twin primes, but sieve n instead of k, which is what I think newpgen does. Last fiddled with by jasong on 2007-11-23 at 20:59
 2007-11-23, 21:45 #2 Citrix     Jun 2003 2·7·113 Posts Yes newpgen and srsieve can do it.
2007-11-23, 21:47   #3
mdettweiler
A Sunny Moo

Aug 2007
USA (GMT-5)

3·2,083 Posts

Quote:
 Originally Posted by Citrix Yes newpgen and srsieve can do it.
Really? I always thought srsieve couldn't do fixed-n sieving; otherwise, I think the TPS project would be using it instead of NewPGen (since from what I hear, srsieve is supposed to be a LOT faster).

 2007-11-23, 21:47 #4 kar_bon     Mar 2006 Germany 23·5·73 Posts that's right, newpgen does: choose as type "Twin" and fill base, n, kmin and kmax (you can check "include even values of k" too to search more candidates and more chance to find a twin).
2007-11-23, 21:54   #5
Citrix

Jun 2003

2×7×113 Posts

Quote:
 Originally Posted by Anonymous Really? I always thought srsieve couldn't do fixed-n sieving; otherwise, I think the TPS project would be using it instead of NewPGen (since from what I hear, srsieve is supposed to be a LOT faster).

2007-11-23, 22:20   #6
axn

Jun 2003

53×41 Posts

Quote:
 Originally Posted by jasong I have someone who I trust that says that a certain k should be dense with primes based on his Number Theory research(he's working on a paper). I was wondering if there's a program to sieve twin primes, but sieve n instead of k, which is what I think newpgen does.
There are no software that I know of that can do this on its own. However, with a bit of manual intervention, you can coax NewPGen into doing it. Essentially, you'll have to sieve the + side first, followed by - side, while carefully messing with the header so that you sieve both properly. You can also try with srsieve, since it can sieve + and - sequences together (together but separate -- not like proper "twin sieving"), but here also, you'll have to do some trial & error to figure out how best to do it (there might be some trouble if the same k appears both for + and -)

Or, you could just ask geoff to code something up specifically for twins -- shouldn't be /that/ much of a big deal.

Last fiddled with by axn on 2007-11-23 at 22:22

2007-11-23, 22:45   #7
Citrix

Jun 2003

2·7·113 Posts

Quote:
 Originally Posted by axn1 There are no software that I know of that can do this on its own. However, with a bit of manual intervention, you can coax NewPGen into doing it. Essentially, you'll have to sieve the + side first, followed by - side, while carefully messing with the header so that you sieve both properly. You can also try with srsieve, since it can sieve + and - sequences together (together but separate -- not like proper "twin sieving"), but here also, you'll have to do some trial & error to figure out how best to do it (there might be some trouble if the same k appears both for + and -) Or, you could just ask geoff to code something up specifically for twins -- shouldn't be /that/ much of a big deal.
You could use k'=k*k and base =4 instead of 2, search on the -1 side.

2007-11-23, 22:55   #8
mdettweiler
A Sunny Moo

Aug 2007
USA (GMT-5)

11000011010012 Posts

Quote:
 Originally Posted by Citrix Read jasong's post carefully
Oh, I see now. I thought he was asking about a fixed-n sieve, whereas he was really asking about a fixed-k sieve. Whoopsie!

2007-11-23, 22:57   #9
mdettweiler
A Sunny Moo

Aug 2007
USA (GMT-5)

3·2,083 Posts

Quote:
 Originally Posted by axn1 There are no software that I know of that can do this on its own. However, with a bit of manual intervention, you can coax NewPGen into doing it. Essentially, you'll have to sieve the + side first, followed by - side, while carefully messing with the header so that you sieve both properly. You can also try with srsieve, since it can sieve + and - sequences together (together but separate -- not like proper "twin sieving"), but here also, you'll have to do some trial & error to figure out how best to do it (there might be some trouble if the same k appears both for + and -) Or, you could just ask geoff to code something up specifically for twins -- shouldn't be /that/ much of a big deal.
Why not just simply sieve the -1 side, then edit the header so that LLR will realize you're searching for twins; LLR will then test all the -1 candidates, and if it finds a prime, it will test the +1 too. (Please note that it doesn't go the other way around, as far as I know.) I think that's usually the way twin prime searches are done.

2007-11-23, 23:49   #10
axn

Jun 2003

10100000001012 Posts

Quote:
 Originally Posted by Citrix You could use k'=k*k and base =4 instead of 2, search on the -1 side.
That's one of those ideas where you go "D'oh, why didn't I think of that!". This should work well with NewPGen. Srsieve has a limitation of k < 2^64, so you'll be limited to 32 bit k's only.

2007-11-23, 23:50   #11
axn

Jun 2003

53×41 Posts

Quote:
 Originally Posted by Anonymous Why not just simply sieve the -1 side, then edit the header so that LLR will realize you're searching for twins; LLR will then test all the -1 candidates, and if it finds a prime, it will test the +1 too. (Please note that it doesn't go the other way around, as far as I know.) I think that's usually the way twin prime searches are done.
Yes, but sieving on the + side will take out even more candidates and you'll get a much smaller list. Why test the - side when you know the + side has a small factor and therefore can't be a twin?

 Similar Threads Thread Thread Starter Forum Replies Last Post hydeer Lone Mersenne Hunters 9 2018-04-03 22:54 mathPuzzles Math 10 2017-06-24 08:41 cuBerBruce Puzzles 3 2014-12-01 18:15 MooooMoo Twin Prime Search 115 2010-08-29 17:38 MooooMoo Twin Prime Search 2 2006-05-11 23:38

All times are UTC. The time now is 00:21.

Sun Sep 26 00:21:08 UTC 2021 up 64 days, 18:50, 0 users, load averages: 1.17, 1.57, 1.74