mersenneforum.org Gap symmetry, n-interprimes, primorials
 Register FAQ Search Today's Posts Mark Forums Read

2019-03-08, 08:57   #12
axn

Jun 2003

470810 Posts

Quote:
 Originally Posted by robert44444uk Gosh, I am getting muddled with my zero's. It was 1.5e11 Now I am up to 5e11, and have three cores working on ranges up to 4e12. Still no 10-interprime though.
How are you doing the searching?

2019-03-08, 09:49   #13
robert44444uk

Jun 2003
Oxford, UK

5×379 Posts

Quote:
 Originally Posted by robert44444uk I'm a bit worried that I can't find literature on prime gaps mod3. Google isn't what it used to be. There appears to be bits 'n pieces of lit around gaps mod6, given that these are noticeably spiky on graphs of gap frequency over a given range. A couple of statements I have read seem to suggest that the numbers of 0mod3 gaps is equal to 50% of gaps - but the evidence over the first 100000 gaps suggested 41.9% - this is surely far too large a difference for 50% to be the long run average.
Astoundingly (well to me anyway) it looks as if the numbers of gaps 0mod3 does tend to 50% of all gaps. Here is the data for gaps in the integer range from 2 to 10^x Must be the law of small numbers at play.

One remark: there does not appear to be a much of a race between 1mod3 gaps and 2mod3 gaps - you don't get that with the primes, where there are notable races at varying x in pmodx.
A quick run for primes from 2 to 9973 shows that that there are only three possible position in the gapmod3 race:
cumulatively 1mod3 one ahead of 2mod3 - occurs only once, all prime gaps up to p=3
cumulatively 1mod3 equal to 2mod3 - occurs 50% of the time
cumulatively 1 mod3 one behind 2mod3 - occurs 50% of the time.

This demonstrates Dr S's comments on permissible gaps patterns mod3

Table shows

A = tested integer range from 2 to 10^A
B = cumulative total of gaps that are 0mod3
C = cumulative total of gaps that are 1mod3
D = cumulative total of gaps that are 2mod3
E = cumulative gap total
F = ratio of 0mod3 gaps to total gaps

Code:
A	B	C	D	E	F

10	0	2	2	4	0
100	7	9	9	25	0.28
1000	53	57	58	168	0.31547619
10000	471	379	379	1229	0.383238405
100000	3853	2869	2870	9592	0.401688907
1000000	32821	22838	22839	78498	0.418112563
10000000	286009	189285	189285	664579	0.430361176
100000000	2528513	1616471	1616471	5761455	0.438867092
1000000000	22633034	14107250	14107250	50847534	0.445115667
10000000000	204759775	125146368	125146368	455052511	0.449969553

Here is a simple graph showing the 0.5 tendency
Attached Thumbnails

Last fiddled with by robert44444uk on 2019-03-08 at 10:09

2019-03-08, 10:11   #14
robert44444uk

Jun 2003
Oxford, UK

5·379 Posts

Quote:
 Originally Posted by axn How are you doing the searching?
Here's a perl program - not very efficient, but does not fall over:

Code:
#!/usr/bin/env perl
use warnings;
use strict;
use Math::Prime::Util qw/:all/;
use Math::Prime::Util::GMP;
use v5.10;
use Data::Dump qw(dump);
use File::Slurp;
use List::Util qw( min max );
use List::MoreUtils ':all';
$|=1; my$start = 400_000_000_000;
my $end = 600_000_000_000; for (my$k=$start;$k <=$end;$k+=1_000_000_000) {
my $l =$k+1_000_000_000;
say "starting range from: ", $k," to : ",$l;
forprimes   {
my $x = (($_+next_prime($_))/2); if (next_prime($x)%1e8 < $x%1e8) {say "done to ",$x;}
my $oneminus = prev_prime($x);
my $oneplus = next_prime($x);
if ($x-$oneminus == $oneplus-$x) {
my $twominus = prev_prime($oneminus);
my $twoplus = next_prime($oneplus);
if ($x-$twominus == $twoplus-$x) {
my $threeminus = prev_prime($twominus);
my $threeplus = next_prime($twoplus);
if ($x-$threeminus == $threeplus-$x) {
my $fourminus = prev_prime($threeminus);
my $fourplus = next_prime($threeplus);
if ($x-$fourminus == $fourplus-$x) {
my $fiveminus = prev_prime($fourminus);
my $fiveplus = next_prime($fourplus);
if ($x-$fiveminus == $fiveplus-$x) {
my $sixminus = prev_prime($fiveminus);
my $sixplus = next_prime($fiveplus);
if ($x-$sixminus == $sixplus-$x) {
my @factored = factor ($x); #say$x,"=factors as: ", dump @factored;
#say "6 ",$x," ",$sixminus," ", $fiveminus," ",$fourminus," ", $threeminus," ",$twominus," ",$oneminus," ",$oneplus," ", $twoplus," ",$threeplus," ",$fourplus," ",$fiveplus," ",$sixplus; my$sevenminus = prev_prime($sixminus); my$sevenplus = next_prime($sixplus); if ($x-$sevenminus ==$sevenplus-$x) { say "7 ",$x," ",$sevenminus," ",$sixminus," ", $fiveminus," ",$fourminus," ", $threeminus," ",$twominus," ",$oneminus," ",$oneplus," ", $twoplus," ",$threeplus," ",$fourplus," ",$fiveplus," ",$sixplus," ",$sevenplus;
my $eightminus = prev_prime($sevenminus);
my $eightplus = next_prime($sevenplus);
if ($x-$eightminus == $eightplus-$x) {
say "8 ",$x," ",$eightminus," ",$sevenminus," ",$sixminus," ", $fiveminus," ",$fourminus," ", $threeminus," ",$twominus," ",$oneminus," ",$oneplus," ", $twoplus," ",$threeplus," ",$fourplus," ",$fiveplus," ",$sixplus," ",$sevenplus," ",$eightplus; my$nineminus = prev_prime($eightminus); my$nineplus = next_prime($eightplus); if ($x-$nineminus ==$nineplus-$x) { say "9 ",$x," ",$nineminus," ",$eightminus," ",$sevenminus," ",$sixminus," ", $fiveminus," ",$fourminus," ", $threeminus," ",$twominus," ",$oneminus," ",$oneplus," ", $twoplus," ",$threeplus," ",$fourplus," ",$fiveplus," ",$sixplus," ",$sevenplus," ",$eightplus," ",$nineplus;
my $tenminus = prev_prime($nineminus);
my $tenplus = next_prime($nineplus);
if ($x-$tenminus == $tenplus-$x) {
say "10 ",$x," ",$tenminus," ",$nineminus," ",$eightminus," ",$sevenminus," ",$sixminus," ", $fiveminus," ",$fourminus," ", $threeminus," ",$twominus," ",$oneminus," ",$oneplus," ", $twoplus," ",$threeplus," ",$fourplus," ",$fiveplus," ",$sixplus," ",$sevenplus," ",$eightplus," ",$nineplus," ",$tenplus; my$elevenminus = prev_prime($tenminus); my$elevenplus = next_prime($tenplus); if ($x-$elevenminus ==$elevenplus-$x) { say "11 ",$x," ",$elevenminus," ",$tenminus," ",$nineminus," ",$eightminus," ",$sevenminus," ",$sixminus," ", $fiveminus," ",$fourminus," ", $threeminus," ",$twominus," ",$oneminus," ",$oneplus," ", $twoplus," ",$threeplus," ",$fourplus," ",$fiveplus," ",$sixplus," ",$sevenplus," ",$eightplus," ",$nineplus," ",$tenplus," ",$elevenplus;
}}}}}}}}}}}

} $k,$l;

say "completed range from ", $k, " to ",$l;
}

2019-03-08, 11:28   #15
axn

Jun 2003

470810 Posts

Quote:
 Originally Posted by robert44444uk Here's a perl program - not very efficient, but does not fall over:
How long does it take to complete a range of 100 billion (running on a single core)?

2019-03-08, 12:55   #16
robert44444uk

Jun 2003
Oxford, UK

5×379 Posts

Quote:
 Originally Posted by axn How long does it take to complete a range of 100 billion (running on a single core)?
Not keeping tabs on that - but about 12 hours on a pretty standard older (5+ years) but high spec desktop - that is a ballpark number.

I have no doubt this could be speeded up a lot with some canny programming and short cuts

 2019-03-08, 18:08 #17 mart_r     Dec 2008 you know...around... 3×197 Posts I've found a 10-interprime during a 20-hour-search on my PC at work: 1,797,595,814,863 1,797,595,814,873 1,797,595,814,897 1,797,595,814,921 1,797,595,814,939 1,797,595,814,941 1,797,595,814,951 1,797,595,814,977 1,797,595,815,011 1,797,595,815,013 1,797,595,815,017 1,797,595,815,019 1,797,595,815,053 1,797,595,815,079 1,797,595,815,089 1,797,595,815,091 1,797,595,815,109 1,797,595,815,133 1,797,595,815,157 1,797,595,815,167 interprime = 1,797,595,815,015 = 3 * 2,347,451 * 17# / 2 The task inspired me to speed up my own VBA program a bit, so now I can search about 110e9 per hour (i5 @ 3 GHz; if you want to, I can post the code), which isn't quite state of the art, but I'm a bit relieved today after I read yesterday that you searched to "1.5e13", but apparently you changed that. Maybe I'll continue the search next week.
 2019-03-08, 22:13 #18 danaj   "Dana Jacobsen" Feb 2011 Bangkok, TH 2·3·151 Posts Some simple transforms of Robert's code give a ~2x speedup, or about 22e9/hour on a single-thread Macbook. But then perhaps we notice that oneminus and oneplus are just the last and current prime which we already have, so we can remove those calls entirely along with the other prev/next calls before them. Still at only 34e9/hour though. It looks like the whole thing can just be run using some lag and a small array, so no need for any of the prev/next calls. As an experiment, I modified forprimes to only return for 3-interprimes. The rest of the code I left alone since the number of actual calls is a much more reasonable number. It runs at 4300e9/hour now. This is just a hack of the C code. Looks like adding one more level (4-interprimes) gets to about 5000e9/hour. It found the first 9-interprime in a little under 1 second. The 10 interprime took about 29 minutes. Using this method, the fastest would probably be some C code using primesieve. Pari/GP would probably do a decent job also. Perl/ntheory is going to suffer just because of how slow Perl is -- I'm avoiding that by using the C code directly for the first part, so it's probably not much slower than primesieve until up in the 1e14 range at least.
 2019-03-08, 23:12 #19 robert44444uk     Jun 2003 Oxford, UK 5·379 Posts I'm travelling again. But really ...astonishing!! chaps
 2019-03-09, 01:16 #20 danaj   "Dana Jacobsen" Feb 2011 Bangkok, TH 2·3·151 Posts Also see A055381 and A055382. It seems they've already found the first ones up to 12-interprime. Apparently there was a distributed project using primesieve.
2019-03-09, 08:24   #21
robert44444uk

Jun 2003
Oxford, UK

5×379 Posts

Quote:
 Originally Posted by danaj Also see A055381 and A055382. It seems they've already found the first ones up to 12-interprime. Apparently there was a distributed project using primesieve.
Well I'm not totally surprised that we are not the first. But I'm disappointed that I did not spot these two lists.

2019-03-11, 14:21   #22
Bobby Jacobs

May 2018

3·5·13 Posts

Quote:
 Originally Posted by robert44444uk The list for 4-interprimes looks quite odd! 15645,19425,34485,34845,35988,46641... 5-interprimes..783630 is the only one up I could find up to pi(100000). Consecutive nearby primes are 783569 (61 away), 783571 (59 away), 783599 (31 away), 783613 (17 away), 783619 (11 away), 783641 (11 away), 783647 (17 away), 783661 (31 away), 783677 (59 away) and 783689 (61 away). The gap sequence is 2,28,14,6,22,6,14,28,2
The 4 primes before and after 15645 are 15619, 15629, 15641, 15643, 15647, 15649, 15661, 15667. Their differences are -26, -16, -4, -2, 2, 4, 16, 22. Therefore, 15645 is only a 3-interprime. Also, 783677 is 47 away from 783630, and 783689 is 59 away. You might want to check your interprime lists.

Last fiddled with by Bobby Jacobs on 2019-03-11 at 14:24

 Similar Threads Thread Thread Starter Forum Replies Last Post siegert81 Math 6 2010-12-28 15:17 Joppe_Bos Factoring 67 2008-01-29 13:51 grandpascorpion Math 9 2005-02-10 07:13

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

Wed Oct 21 21:33:28 UTC 2020 up 41 days, 18:44, 0 users, load averages: 2.09, 1.69, 1.58