cp's OEIS Frontend

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.

A179067 Orders of consecutive clusters of twin primes.

This page as a plain text file.
%I A179067 #16 Dec 05 2024 22:42:28
%S A179067 1,3,1,1,1,1,2,2,3,1,1,1,1,1,1,2,1,1,1,1,1,1,1,3,1,1,2,2,1,1,1,1,1,1,
%T A179067 1,1,1,2,1,1,1,1,1,1,2,2,1,1,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,1,1,2,
%U A179067 1,1,3,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,3,2,1,1,1,1,1,1,1
%N A179067 Orders of consecutive clusters of twin primes.
%C A179067 For k>=1, 2k+4 consecutive primes P1, P2, ..., P2k+4 defining a cluster of twin primes of order k iff P2-P1 <> 2, P4-P3 = P6-P5 = ... = P2k+2 - P2k+1 = 2, P2k+4 - P2k+3 <> 2.
%C A179067 Also the lengths of maximal runs of terms differing by 2 in A029707 (leading index of twin primes), complement A049579. - _Gus Wiseman_, Dec 05 2024
%H A179067 Robert Israel, <a href="/A179067/b179067.txt">Table of n, a(n) for n = 1..10000</a>
%H A179067 Gus Wiseman, <a href="/A373403/a373403.txt">Four statistics for runs and antiruns of prime, nonprime, squarefree, and nonsquarefree numbers</a>.
%e A179067 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.
%e A179067 From _Gus Wiseman_, Dec 05 2024: (Start)
%e A179067 The leading indices of twin primes are:
%e A179067   2, 3, 5, 7, 10, 13, 17, 20, 26, 28, 33, 35, 41, 43, 45, 49, 52, ...
%e A179067 with maximal runs of terms differing by 2:
%e A179067   {2}, {3,5,7}, {10}, {13}, {17}, {20}, {26,28}, {33,35}, {41,43,45}, {49}, {52}, ...
%e A179067 with lengths a(n).
%e A179067 (End)
%p A179067 R:= 1: count:= 1: m:= 0:
%p A179067 q:= 5: state:= 1:
%p A179067 while count < 100 do
%p A179067  p:= nextprime(q);
%p A179067  if state = 1 then
%p A179067     if p-q = 2 then state:= 2; m:= m+1;
%p A179067     else
%p A179067       if m > 0 then R:= R,m; count:= count+1; fi;
%p A179067       m:= 0
%p A179067     fi
%p A179067  else state:= 1;
%p A179067  fi;
%p A179067  q:= p
%p A179067 od:
%p A179067 R; # _Robert Israel_, Feb 07 2023
%t A179067 Length/@Split[Select[Range[2,100],Prime[#+1]-Prime[#]==2&],#2==#1+2&] (* _Gus Wiseman_, Dec 05 2024 *)
%o A179067 (PARI) 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
%Y A179067 Cf. A077800.
%Y A179067 Cf. A001359, A111950, A087641.
%Y A179067 Cf. A035789, A035790, A035791, A035792, A035793, A035794, A035795.
%Y A179067 A000040 lists the primes, differences A001223 (run-lengths A333254, A373821).
%Y A179067 A006512 gives the greater of twin primes.
%Y A179067 A029707 gives the leading index of twin primes, complement A049579.
%Y A179067 A038664 finds the first prime gap of length 2n.
%Y A179067 A046933 counts composite numbers between primes.
%Y A179067 A000720, A006560, A006562, A014574, A037201, A107770, A122535, A155752, A175632, A251092.
%K A179067 easy,nonn
%O A179067 1,2
%A A179067 _Franz Vrabec_, Jun 27 2010
%E A179067 More terms from _M. F. Hasler_, May 04 2015