![]() |
![]() |
#133 |
Dec 2008
you know...around...
32×71 Posts |
![]()
Here's the first occurence data in the range k=6e15 to 6.5e15 and for gaps >= 4000*6:
Code:
4000 6094571062162170 4001 6075920626075277 4002 6014183106259230 4003 6203486197159115 4004 6137452198599068 4005 6185136680377518 4006 6360517752405187 4008 6003948316407272 4009 6329221631091503 4010 6241621066414382 4011 6437932440799447 4012 6064189427508508 4013 6091258905373537 4014 6290713103642573 4015 6011624442750153 4016 6098683312987962 4017 6071685243027793 4018 6265250066459102 4019 6283414188263733 4020 6141871001541490 4021 6432249414755927 4023 6079131996919242 4024 6235220231561513 4025 6019533778987152 4026 6194087059750802 4027 6226570078801793 4028 6053806834581767 4030 6009639339321032 4031 6133398547907137 4032 6052308387984005 4034 6339008746970338 4035 6046297602061560 4036 6165971245882707 4037 6040097294341698 4039 6483441933970673 4040 6030358581920563 4042 6122715569797250 4043 6084819609427240 4045 6064741064731220 4046 6105280065069657 4047 6370174910931673 4048 6047203955033852 4050 6035566050333095 4051 6341241132855102 4052 6304575087486345 4053 6164868853236555 4054 6075053192180928 4055 6092662638064497 4056 6015277975679772 4057 6001400253636420 4058 6040061104229857 4060 6056119854536987 4062 6263538579503278 4063 6325165860124757 4064 6100071331717473 4065 6062778881427940 4066 6241480910046077 4068 6020280443408017 4069 6012115289658033 4070 6296160629463257 4071 6139360540024717 4073 6005091591205472 4074 6114415979573773 4075 6285311374248945 4076 6273699085480472 4077 6324631782081440 4078 6357289430499355 4080 6058920186189490 4081 6052150891125197 4082 6232687723771443 4084 6091687796251498 4085 6230196866005635 4086 6078217615093407 4088 6496775139639537 4090 6119641029856492 4092 6202134162351435 4093 6419296472489465 4095 6163720106533033 4096 6203286774555112 4097 6103435310161558 4099 6325478506209408 4100 6116340465121010 4101 6355525139396417 4102 6174426844259965 4103 6157644909452880 4104 6298423150626903 4105 6162951787510277 4107 6247911818702663 4108 6161298941820012 4109 6491143111771663 4110 6001197641210922 4115 6178419659403778 4118 6096457491930097 4120 6184783264368112 4122 6360908928015520 4123 6100104578451060 4124 6311921669621948 4125 6068766964843665 4127 6425468039803410 4128 6037155878905807 4130 6034609587028502 4132 6349703990951890 4133 6227785213403945 4134 6046360591439598 4135 6135763865589705 4137 6167496502269783 4138 6184512798067860 4139 6312979228278488 4140 6042989127566540 4142 6154125015116090 4143 6010071056539260 4144 6006071589055498 4148 6045475721125802 4150 6143274987321798 4151 6211308403602407 4152 6211187980017218 4153 6115300701726272 4155 6024618880584370 4156 6165521195264137 4158 6089346501853585 4160 6009304072960370 4161 6198884291928232 4162 6177933687337613 4163 6127328267668965 4168 6267472535063905 4169 6083076911732653 4170 6420547446129392 4172 6261910700353485 4173 6262682960653837 4174 6340146887231083 4175 6292281218620518 4177 6157376896724338 4178 6160049855283320 4179 6373535030180763 4180 6133153668695540 4182 6478615816691820 4183 6212849761519677 4184 6011557251426258 4186 6464275260196747 4190 6173448467901958 4191 6053088670191087 4193 6018034505747897 4195 6019058576097432 4197 6295991689062505 4198 6115519475532800 4200 6197019800677087 4202 6297350794498500 4203 6087072764015532 4204 6456922859790263 4205 6130207210578745 4207 6009282685284770 4209 6002620211819773 4210 6298459464206870 4212 6304558953941703 4213 6331264705699825 4214 6070154999354528 4218 6148455048801385 4220 6182248338193338 4222 6064737061669008 4223 6068403816384367 4225 6041758660303985 4227 6285351143257763 4228 6028967627388702 4230 6095374747085445 4232 6308774830833160 4234 6472692620842438 4235 6032979702833583 4237 6223205133275135 4238 6355374326245737 4240 6111908871339233 4241 6040034267138427 4242 6085196195064775 4243 6305783891702710 4245 6044376436470603 4246 6468946760770807 4247 6337105660583213 4248 6409944492128042 4249 6123697391111678 4250 6149335180098092 4252 6151630983571378 4255 6101454388044922 4258 6055790842660410 4260 6236686071294943 4263 6424780177608930 4264 6072146817273063 4265 6272591475644555 4267 6037043089823795 4268 6096265411960257 4270 6377607685513617 4279 6118746171209448 4282 6346321057983923 4284 6404713277248748 4285 6124431663478998 4286 6106864751888057 4290 6264005685032037 4294 6187094564948983 4297 6489194348922498 4300 6000819923220717 4304 6080283436260038 4307 6360859588244695 4310 6336339484988490 4312 6068645852207570 4315 6052524000168543 4318 6148050526109665 4319 6026168702035498 4325 6230389263509745 4329 6323968769952428 4332 6430852847858808 4340 6338869827197252 4342 6144349027455298 4345 6124153943777070 4347 6135802376537215 4348 6276138229374072 4350 6054630814349292 4359 6311689567068163 4361 6315196750271272 4362 6084686902740198 4365 6128337936448283 4370 6342758660193728 4373 6202809716263480 4375 6137085163794373 4380 6250550842918960 4383 6001908527568025 4387 6077019630255373 4389 6499375127978028 4393 6289545895261027 4397 6277187164591478 4398 6489557912371410 4399 6469431967067538 4400 6146318193742877 4403 6232758496784040 4408 6213855204309090 4411 6012601808077337 4412 6035100023021865 4413 6086319365061985 4415 6463032243475532 4416 6279331129379157 4417 6084726611182070 4422 6058991382502105 4429 6055631253850623 4431 6218464321412922 4433 6452357611752337 4438 6257940818504007 4440 6404995105946990 4444 6026965908810528 4450 6093156525023668 4454 6499923087085358 4475 6115604180101397 4480 6201028692692617 4493 6058262748772790 4495 6283997654300398 4500 6432348112790863 4510 6149461651877038 4514 6306079042402963 4516 6193851656374552 4522 6240850066573573 4531 6049027718630057 4535 6392339912840788 4543 6389733723572952 4579 6462678073366078 4580 6207962315678163 4598 6073062207003957 4604 6062440255100688 4605 6371483174248552 4618 6208363632486995 4643 6353259076181440 4648 6237870159894132 4651 6063632091303742 4655 6216475783941955 4667 6409865780683138 4671 6087386050564807 4683 6156812464374737 4684 6062732223084008 4693 6212889974756245 4702 6049374079170973 4730 6081683340020388 4760 6429759578479347 4775 6405308047710198 4811 6426409727841007 4817 6041839013682615 4846 6100407976215147 4890 6158875096649807 4924 6161033965365603 4927 6277201048947448 4971 6201911946722937 5252 6223092271519683 5320 6327092175736258 5507 6436329324869348 |
![]() |
![]() |
![]() |
#134 |
Dec 2008
you know...around...
32×71 Posts |
![]()
In case you haven't updated the list with my previous results yet, attached is also my previous first occurence list (4.5e15 to 5e15) with the count of the single primes.
|
![]() |
![]() |
![]() |
#135 |
May 2018
22×53 Posts |
![]()
What is the list of all new maximal twin prime gaps you have found in order?
|
![]() |
![]() |
![]() |
#136 |
Jun 2003
Oxford, UK
22×3×7×23 Posts |
![]()
Sorry. I'm traveling at the mo. Do plan to update at some stage
|
![]() |
![]() |
![]() |
#137 |
Dec 2008
you know...around...
11778 Posts |
![]()
I'd like to continue here with the range 6.5e15 to 6.6e15.
|
![]() |
![]() |
![]() |
#138 |
Dec 2008
you know...around...
11778 Posts |
![]()
Results 6.5e15 to 6.6e15 (only new entries):
Code:
gap k # single primes 4333 6533135369970037 609 4464 6558949607080003 637 4498 6532616565216252 650 4565 6571276803702410 684 4593 6556530616266752 670 4599 6562341576429613 705 4612 6509617279610035 712 4632 6517377286609478 721 4965 6513798244437545 711 |
![]() |
![]() |
![]() |
#139 |
Dec 2008
you know...around...
32×71 Posts |
![]()
On a whim, I sat down this morning and within two hours, I built from scratch a twin gap search routine in Pari that's already almost half as fast as the Perl code.
I'm not an expert programmer, so I'm pretty sure with a few adjustments and in a language other than Pari, it should be possible to speed things up considerably. Here's my crummy code: Code:
{ k=6422555400000000; g=3900; j=832; u=128; r=9699690; z=378675; v=vector(z); w=vector(1485); x=1; forprime(y=23,887,x*=y); a=0; print("twins matrix 13#"); for(b=1,5005, if(gcd(6*b-1,30030)==1&&gcd(6*b+1,30030)==1,a+=1;w[a]=6*b) ); print("twins matrix 19#"); l=0; for(m=0,r/30030-1, for(b=1,a, if(gcd(30030*m+w[b]-1,r)==1&&gcd(30030*m+w[b]+1,r)==1,l+=1;v[l]=30030*m+w[b]) ) ); if(l==z,print("OK, "gettime()"ms")); print("searching, k="k); k*=6; k=r*floor(k/r); a=1; i=1; while(i, p=k+v[a]; a+=1; if(a>z,a=1;k+=r); if(gcd(p-1,x)==1&&gcd(p+1,x)==1, if(ispseudoprime(p-1)&&ispseudoprime(p+1),i=0) ) ); while(1, h=1; while(h, a+=j; if(a>z,a-=z;k+=r); b=0; c=k;d=a; i=1; while(i, p=k+v[a]; a+=1; b+=1; if(a>z,a=1;k+=r;print("searching, k="k/6)); if(gcd(p-1,x)==1&&gcd(p+1,x)==1, if(ispseudoprime(p-1)&&ispseudoprime(p+1),i=0) ) ); if(b>u,h=0) ); q=p; e=k;f=a; i=1; k=c;a=d; while(i, a-=1; if(a<1,a=z;k-=r); p=k+v[a]; if(gcd(p-1,x)==1&&gcd(p+1,x)==1, if(ispseudoprime(p-1)&&ispseudoprime(p+1),i=0) ) ); if(q-p>6*g, print((q-p)/6" "p/6); write("twins_output.txt",(q-p)/6" "p/6,Strchr(13)) ); k=e;a=f ) } g: gap reporting threshold (likewise) j: jumping value (see below) - this is manually set, together with u ("undercount" - had that word in mind while choosing the variable, nevermind:) I used a variable (y=887#/19#) for a gcd routine (trial division) before an ispseudoprime test, as Pari seems to only check for factors up to 101 in the order of magnitude k is in. The 887 here seems to be close to optimal for that purpose. I don't know if later versions of Pari use other parameters for an isprime or ispseudoprime test, so that part of the program is open for discussion. The approach is pretty straightforward (I guess). A vector of 378675 integers between 6 and 9699690 is built, where values v are stored for which v-1 and v+1 are coprime to 19#. (I did this in two steps, so instead of 11 secs it only takes 3 secs at the beginning of the program.) Then the search runs through values of k, with a jump of 832 values of v after a twin prime is found, and after every such jump, if a twin prime is found within another 128 values of v, a backward search picks up to look for a twin prime in the interval that has been jumped. (Sounds a bit funny... oh whatever.) That means, in the worst case, 960 values of v have to be without a twin prime to be detected. The largest gap between 960 values of v is 24972, or 6*4162, whereas the smallest not yet recorded maximal gap is 6*4206, so no maximal gap should be missed. The current version of my code above duly finds the next two gaps >6*3900 in under two minutes on the PC I'm working on. ---> Possible optimizations within the code? ---> How much faster can this work in Perl or C[++]? |
![]() |
![]() |
![]() |
#140 |
Dec 2008
you know...around...
32·71 Posts |
![]()
With a precalculated interval of 23# (7,952,175 values of v for which a twin prime mod 23# is admissible), and a Mod(3,n)^(n-1) test instead of ispseudoprime(n), I was able to get 54% of the speed of the Perl program.
From what I gather, the customized prime tests in Perl or C are (much?) more efficient than in Pari. Currently the throughput on my fast PC is about 27e6 k/s/core, and 10.9e6 k/s/core on my laptop, where I get 5.90e6 k/s/core with my own Pari code. I'd like to continue the search, but before I do that, I'd like to know how much faster the program can get. |
![]() |
![]() |
![]() |
#141 | |
Sep 2002
Database er0rr
2×72×37 Posts |
![]() Quote:
You might get more throughput in Pari/GP by aligning your n. |
|
![]() |
![]() |
![]() |
#142 |
Feb 2003
22×32×53 Posts |
![]()
Regarding an implementation in C:
I slightly modified Tomás Oliveira e Silva's fast_sieve.c from 2010 in order to search for gaps between twin primes (see attachment). It seems to be pretty fast already (around 100e6 k/s/core). Perhaps this could be used as a base for further improvements. Usage example: Code:
kmin=6422555400000000 kmax=6422560000000000 mingap=3000 ./twingaps -k1 $kmin -k2 $kmax -mingap $mingap >> logfile.txt Last fiddled with by Thomas11 on 2019-12-30 at 09:30 |
![]() |
![]() |
![]() |
#143 | ||
Dec 2008
you know...around...
27F16 Posts |
![]() Quote:
Code:
// assumptions: Linux, GNU libc, C99-capable compiler Could you provide a Win executable? As long as it's no trouble, of course. Quote:
Meanwhile, here's the data for 6.6e15 to 6.684e15: Code:
gap k # single primes 4206 6650801286755762 619 4320 6603223408106523 657 4359 6629775407330098 628 4450 6628852021999928 681 4462 6601637753498165 698 4624 6669047311697568 711 4649 6602043547162233 703 4658 6678195146158970 709 4695 6622871858769833 673 5211 6647995738937662 801 BTW, a quad search specifically for (p+0, p+2, p+25434, p+25436) would be faster than the twin search, but probably slower than the twin search in general depending on how many different gaps we want to look at (and maybe duplicating work). Also depends on how much the twin search can be sped up with rising smallest gap. Any thoughts? |
||
![]() |
![]() |
![]() |
Thread Tools | |
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Gaps between maximal prime gaps | Bobby Jacobs | Prime Gap Searches | 52 | 2020-08-22 15:20 |
I found a sieve to search all pairs of twin primes | Pietro Maiorana | Twin Prime Search | 8 | 2019-09-26 23:07 |
find very easy twin prime in the infamy twin primes | hal1se | Miscellaneous Math | 13 | 2018-11-05 16:34 |
Mersenne Primes p which are in a set of twin primes is finite? | carpetpool | Miscellaneous Math | 3 | 2017-08-10 13:47 |
Gaps of Primes? | PawnProver44 | Miscellaneous Math | 10 | 2016-04-10 19:32 |