![]() |
![]() |
#12 |
"Matthew Anderson"
Dec 2010
Oregon, USA
2·3·107 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 |
![]() |
![]() |
![]() |
#13 |
Aug 2006
3·1,987 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 n-th 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(q-p==2 && r-p==6 && isprime(p+14), listput(v,p)); p=q; q=r); Vec(v) |
![]() |
![]() |
![]() |
#14 |
"Dana Jacobsen"
Feb 2011
Bangkok, TH
2·3·151 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 14-tuplets (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. |
![]() |
![]() |
![]() |
#15 | |
Aug 2006
174916 Posts |
![]() Quote:
![]() |
|
![]() |
![]() |
![]() |
#16 |
"Forget I exist"
Jul 2009
Dumbassville
26×131 Posts |
![]()
if only testing for the starting prime to be 17 mod 30 didn't add time/destroy to your code.
|
![]() |
![]() |
![]() |
#17 |
Aug 2006
174916 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 2017-08-29 at 13:45 |
![]() |
![]() |
![]() |
#18 | |
"Forget I exist"
Jul 2009
Dumbassville
26·131 Posts |
![]() Quote:
|
|
![]() |
![]() |
![]() |
#19 |
Aug 2006
3·1,987 Posts |
![]() |
![]() |
![]() |
![]() |
#20 |
"Forget I exist"
Jul 2009
Dumbassville
20C016 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.
|
![]() |
![]() |
![]() |
#21 |
"Matthew Anderson"
Dec 2010
Oregon, USA
2×3×107 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 |
![]() |
![]() |
![]() |
#22 |
"Matthew Anderson"
Dec 2010
Oregon, USA
12028 Posts |
![]()
HI Mersenne Forum,
Here is a Maple worksheet that produces some sets of 3 primes. Regards, Matt |
![]() |
![]() |
![]() |
Thread Tools | |
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
(M48) NEW MERSENNE PRIME! LARGEST PRIME NUMBER DISCOVERED! | dabaichi | News | 571 | 2020-10-26 11:02 |
Prime Constellations | MattcAnderson | MattcAnderson | 119 | 2018-03-14 20:22 |
Prime constellations? | CRGreathouse | Software | 10 | 2017-07-14 09:45 |
disk died, prime work lost forever? where to put prime? on SSD or HDD? | emily | PrimeNet | 3 | 2013-03-01 05:49 |
The 40th known Mersenne prime, 220996011-1 is not PRIME! | illman-q | Miscellaneous Math | 33 | 2004-09-19 05:02 |