20170825, 21:59  #12 
"Matthew Anderson"
Dec 2010
Oregon, USA
1001010100_{2} Posts 
Hi Mersenneforum,
Here are a few more efforts regarding mathematical constellations. These admissible constellations are not as close as possible to each other. Regards, Matt 
20170826, 20:14  #13 
Aug 2006
2×7×419 Posts 
You're looking for quadruples (p, p+2, p+6, p+14) of primes. Here's the way I would find these. Notice that p+4 must be a multiple of 3, so p, p+2, and p+6 must be consecutive primes. I can then loop through the primes (generated by a sieve), looking for instances of (p, p + 2, p + 6), and then check if p+14 is also prime. If so, I've found an example. This way I only need one primality test and no need to generate the nth prime (which is slow).
A better way would be to store two more primes and test if either one was p+14, avoiding the primality test entirely. (You couldn't fit two primes between p+7 and p+13 for congruence reasons.) But that's a bit more work. My simple code, in GP: Code:
list(lim)=my(v=List(),p=5,q=7);forprime(r=11,nextprime(nextprime(lim\1+1)+1), if(qp==2 && rp==6 && isprime(p+14), listput(v,p)); p=q; q=r); Vec(v) 
20170828, 16:14  #14 
"Dana Jacobsen"
Feb 2011
Bangkok, TH
2·11·41 Posts 
Charles' Pari/GP code is more flexible, but Perl/ntheory has a cluster finder:
Code:
$ perl Mntheory=:all E "say join ' ',sieve_prime_cluster(1, 10000, 2,6,14);" 5 17 227 1277 1607 1997 2237 2267 2657 3527 3917 4637 4787 6197 6827 8087 The more entries in the cluster the faster it gets (in terms of time per range). For this quadruple, it's about 34x faster than the simple Pari/GP script (albeit there are ways that Pari/GP could go faster). As alluded to a long time ago, there is an example script in the ntheory distribution that paralleliizes the search by the simple way of running N ranges at a time, collecting results. That's handy for some of the larger clusters, such as 14tuplets (e.g. http://oeis.org/A257168). There are probably faster methods. Woldvogel and Jens Kruse Andersen have private tools for this, among others. I'm sure there are people on this forum who could write something faster if they desired. 
20170828, 17:12  #15 
Aug 2006
16EA_{16} Posts 
This approach is definitely better, and the factor will increase. Probably you could do it ~3x faster in gp with more care, and perhaps up to twice that fast directly in PARI, but it won't compete with purposebuilt tools for sure.

20170828, 23:07  #16 
"Forget I exist"
Jul 2009
Dumbassville
2^{6}·131 Posts 
if only testing for the starting prime to be 17 mod 30 didn't add time/destroy to your code.

20170829, 13:44  #17 
Aug 2006
16EA_{16} Posts 
Shouldn't be a big deal, the only number that could be divisible by 17 is p+14, but that will be tested for divisibility by 17 in the first step of isprime anyway. (If there were two numbers it would be a bigger deal, since it could avoid testing the first if the second had a small factor.)
Last fiddled with by CRGreathouse on 20170829 at 13:45 
20170829, 14:12  #18  
"Forget I exist"
Jul 2009
Dumbassville
2^{6}×131 Posts 
Quote:


20170829, 14:34  #19 
Aug 2006
2×7×419 Posts 

20170829, 21:55  #20 
"Forget I exist"
Jul 2009
Dumbassville
20C0_{16} Posts 
I looked at it in PARI/GP that's how I came to 17 mod 30 if p is 1 mod 5 ( 1,11, mod 30 after looking only at coprime remainders) then p+14 divides by 5 if p is 1 mod 3 (1,7,13,19 mod 30) then p+2 is divisible by 3. that leaves 17,23,29 mod 30 left. 29 can't have p+6 prime as it divides by 5. 23 can't have p+2 prime as it divides by 5. so 17 mod 30 is the only modular remainder mod 30 that can possibly give such a constellation.

20170830, 02:45  #21 
"Matthew Anderson"
Dec 2010
Oregon, USA
2^{2}×149 Posts 
Hi Mersenne forum,
So I shine a light on some sets of 4 primes. I do this because it is fun for me. Have a look. Regards, Matt 
20170914, 03:49  #22 
"Matthew Anderson"
Dec 2010
Oregon, USA
2^{2}·149 Posts 
HI Mersenne Forum,
Here is a Maple worksheet that produces some sets of 3 primes. Regards, Matt 
Thread Tools  
Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Prime Constellations  MattcAnderson  MattcAnderson  119  20180314 20:22 
Prime constellations?  CRGreathouse  Software  10  20170714 09:45 
NEW MERSENNE PRIME! LARGEST PRIME NUMBER DISCOVERED!  dabaichi  News  561  20130329 16:55 
disk died, prime work lost forever? where to put prime? on SSD or HDD?  emily  PrimeNet  3  20130301 05:49 
The 40th known Mersenne prime, 2209960111 is not PRIME!  illmanq  Miscellaneous Math  33  20040919 05:02 