A069454 Duplicate of A035789.
29, 41, 59, 71, 227, 239, 269, 281, 311, 347, 461, 521, 569, 599, 617, 641, 659, 857
Offset: 1
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.
a(6)=325267931 is the starting point of the first occurrence of 6 consecutive pairs of twin primes: (325267931 325267933) (325267937 325267939) (325267949 325267951) (325267961 325267963) (325267979 325267981) (325267991 325267993).
89, 97, 101, 103, 107, 109, 113, 127: 97-89 > 2, 103-101 = 2, 109-107 = 2, 127-113 > 2.
Select[Prime@ Range@ 2100, And[NextPrime[#, -1] - NextPrime[#, -2] > 2, NextPrime@ # - # == 2, NextPrime[#, 3] - NextPrime[#, 2] == 2, NextPrime[#, 5] - NextPrime[#, 4] > 2] &] (* Michael De Vlieger, Apr 25 2015 *)
a(n)={L=vector(7);forprime(p=o=1,,L=concat(L[2..7],-o+o=p); L[3]==2&&L[5]==2&&L[1]>2&&L[2]>2&&L[4]>2&&L[6]>2&&L[7]>2&&!n--&&return(p-sum(i=3,7,L[i])))} \\ M. F. Hasler, May 04 2015
a(2)=179 because (179,181),(191,193),(197,199) is the second occurrence (after (5,7),(11,13),(17,19)) of exactly 3 pairs of twin primes.
Select[Prime@ Range@ 30000, And[ NextPrime[#, -1] - NextPrime[#, -2] != 2, NextPrime@ # - # == 2, NextPrime[#, 3] - NextPrime[#, 2] == 2, NextPrime[#, 5] - NextPrime[#, 4] == 2, NextPrime[#, 7] - NextPrime[#, 6] > 2] &] (* Michael De Vlieger, Apr 25 2015 *) Select[Partition[Prime[Range[30000]],10,1],#[[8]]-#[[7]]==#[[6]]-#[[5]] == #[[4]] - #[[3]]==2&[[2]]-#[[1]]!=2&[[10]]-#[[9]]!=2&][[All,3]] (* Harvey P. Dale, Mar 14 2018 *)
Prime[Select[Range[1000000], Prime[ # + 1] - Prime[ # ] == 2 && Prime[ # + 3] - Prime[ # + 2] == 2 && Prime[ # + 5] - Prime[ # + 4] == 2 && Prime[ # + 7] - Prime[ # + 6] == 2 &]] (* Tanya Khovanova, Sep 07 2007 *)
lst={};Do[p0=Prime[n];p1=Prime[n+1];p2=Prime[n+2];p3=Prime[n+3];p4=Prime[n+4];p5=Prime[n+5];p6=Prime[n+6];p7=Prime[n+7];p8=Prime[n+8];p9=Prime[n+9];If[p1-p0==p3-p2==p5-p4==p7-p6==p9-p8==2,AppendTo[lst,p0]],{n,10!}];lst (* Vladimir Joseph Stephan Orlovsky, Apr 02 2010 *)
fQ[n_] := Block[{k = 6}, And[NextPrime[n, -1] - NextPrime[n, -2] != 2, NextPrime[n, 2 k + 1] - NextPrime[n, 2 k] != 2, AllTrue[NextPrime[n, # + 1] - NextPrime[n, #] & /@ (Range[0, 2 k - 1, 2]), # == 2 &]]]; Select[Prime@ Range[10^9], fQ] (* Michael De Vlieger, May 09 2015, Version 10 *)
isok(p) = {if (! isprime(p-2) && isprime(p+2), for (k=2, 6, my(q = nextprime(p+3)); if (! isprime(q+2), return (0)); p = q+2;); q = nextprime(p+3); if (isprime(q+2), return (0)); return (1);); return (0);} \\ Michel Marcus, Dec 06 2019
The first twin primes that are not adjacent to twin primes other than their own twins are 29,31 (23 and 37 are non-twin) and 41,43 (37 and 47 are non-twin). So the sequence begins 29,31,41,43.
a069453[n_] := Module[{c6p={3, 5, 7, 11, 13, 17}, seq={}, i=6, last=17}, While[i<=n, If[c6p[[4]]-c6p[[3]]==2 && c6p[[2]]-c6p[[1]]>2 && c6p[[6]]-c6p[[5]]>2, AppendTo[seq, {c6p[[3]], c6p[[4]]}]]; last=NextPrime[last]; c6p=Append[Drop[c6p, 1], last]; i++]; seq] Flatten[a069453[1000]] (* isolated prime pairs less than 1000 *) (* Hartmut F. W. Hoft, Apr 09 2016 *)
The twin prime cluster ((101,103),(107,109)) of order k=2 stems from the 2k+4 = 8 consecutive primes (89, 97, 101, 103, 107, 109, 113, 127) because 97-89 <> 2, 103-101 = 109-107 = 2, 127-113 <> 2. From _Gus Wiseman_, Dec 05 2024: (Start) The leading indices of twin primes are: 2, 3, 5, 7, 10, 13, 17, 20, 26, 28, 33, 35, 41, 43, 45, 49, 52, ... with maximal runs of terms differing by 2: {2}, {3,5,7}, {10}, {13}, {17}, {20}, {26,28}, {33,35}, {41,43,45}, {49}, {52}, ... with lengths a(n). (End)
R:= 1: count:= 1: m:= 0: q:= 5: state:= 1: while count < 100 do p:= nextprime(q); if state = 1 then if p-q = 2 then state:= 2; m:= m+1; else if m > 0 then R:= R,m; count:= count+1; fi; m:= 0 fi else state:= 1; fi; q:= p od: R; # Robert Israel, Feb 07 2023
Length/@Split[Select[Range[2,100],Prime[#+1]-Prime[#]==2&],#2==#1+2&] (* Gus Wiseman, Dec 05 2024 *)
a(n)={my(o,P,L=vector(3));n++;forprime(p=o=3,,L=concat(L[2..3],-o+o=p);L[3]==2||next;L[1]==2&&(P=concat(P,p))&&next;n--||return(#P);P=[p])} \\ M. F. Hasler, May 04 2015
Starting from 1107819732769 = A151799(A151799(1107819732821)), the gaps between the next primes are (40, 12, 2, 88, 2, 4, 2, 28, 2, 10, 2, 16, 2, 58, 2, 22, 2, 24, 16) with 8 occurrences of 2, so 1107819732821 is a term. - _Michel Marcus_, Oct 16 2015
Comments