A090952 Erroneous version of A053778.
3, 5, 11, 17, 101, 137, 179, 191, 419, 809, 821
Offset: 0
This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
Values of P1, P2, P3, P4 corresponding to record gaps: P3-P1 P1 P2 P3 P4 a(n) 6 5 7 11 13 (5+7)/12 = 1 12 137 139 149 151 (137+139)/12 = 23 18 1931 1933 1949 1951 (1931+1933)/12 = 322 30 2969 2971 2999 3001 (2969+2971)/12 = 495
p1=3;p2=5;p3=7;r=0;forprime(p4=11,1e9,if(p2-p1==2&&p4-p3==2,d=p3-p2;if(d>r,r=d;print1((p1+p2)/12,", ")));p1=p2;p2=p3;p3=p4)
pnpk(n, m=2, k=2) = { local(x, v1, v2); for(x=1, n, v1 = prime(x)-k; v2 = prime(x+m)-k; if(isprime(v1)&isprime(v2), print1(x, ", ") ) ) ; } \\ corrected by Amiram Eldar, Oct 04 2024
lista(pmax) = {my(k = 1, p = primes(4)); forprime(p1 = p[#p], pmax, k++; p[#p] = p1; if(p[2]- p[1] == 2 && p[4] - p[3] == 2, print1(k, ", ")); for(i = 1, #p-1, p[i] = p[i+1]));} \\ Amiram Eldar, Oct 04 2024
See A329164.
With[{s = Partition[Prime@ Range[10^5], 4, 1]}, Union@ FoldList[Max, Map[(#3 - #1)/6 & @@ # &, Select[s, #2 - #1 == #4 - #3 == 2 & @@ # &]]]] (* Michael De Vlieger, May 26 2020 *)
p1=3;p2=5;p3=7;r=0;forprime(p4=11,1e9,if(p2-p1==2&&p4-p3==2,d=p3-p1;if(d>r,r=d;print1(d/6,", ")));p1=p2;p2=p3;p3=p4)
A twin pack of primes contains 2 or more pairs of twin primes, between which pairs there are no other primes. 137 is in the sequence because 137,139 are primes and the next primes are 149,151.
state:= 0: p:=13: Res:= 3: count:= 1; while count < 100 do q:= nextprime(p); if state = 0 then if q = p+2 then state:= 1; r:= p; p:= nextprime(q); else p:= q fi; elif state = 1 then if q = p+2 then count:= count+1; Res:= Res, r; state:= 2; p:= nextprime(q); else p:= q; state:= 0 fi else if q = p+2 then p:= nextprime(q); else p:= q; state:= 0 fi fi od: Res; # Robert Israel, Jan 13 2020
Twin prime pairs 5,7 and 11,13 contain only the composite numbers 6,7,8,9,10 between them. So 5 is in the table. 11,13 and 17,19 have no primes between. 11 is in the table. 41,43 and 59,61 have primes 47 and 53 between then so 41 is not listed.
Join[{3},Select[Partition[Prime[Range[1500]],4,1],#[[4]]-#[[3]]==#[[2]]- #[[1]] == 2&][[All,1]]] (* Harvey P. Dale, Dec 15 2018 *)
\save as twinpr.gp pbetweentw(n) = { forstep(x1=1,n,2, c=0; t1 = twin[x1]; t2 = twin[x1+2]; for(y=t1+3,t2-1, if(isprime(y),c++) ); if(c==0,print1(t1",")) ) } savetwins(n) = build a table of twin prime I want to upload a supporting file to store with the OEIS and add a link to it.lower bounds { twin = vector(n); c=1; forprime(x=3,n, if(isprime(x+2), twin[c]=x; c++; ) ) }
Comments