%I #10 Feb 09 2023 09:39:41
%S 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 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 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 Orders of consecutive clusters of twin primes.
%C 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.
%H Robert Israel, <a href="/A179067/b179067.txt">Table of n, a(n) for n = 1..10000</a>
%e 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.
%p R:= 1: count:= 1: m:= 0:
%p q:= 5: state:= 1:
%p while count < 100 do
%p p:= nextprime(q);
%p if state = 1 then
%p if p-q = 2 then state:= 2; m:= m+1;
%p else
%p if m > 0 then R:= R,m; count:= count+1; fi;
%p m:= 0
%p fi
%p else state:= 1;
%p fi;
%p q:= p
%p od:
%p R; # _Robert Israel_, Feb 07 2023
%o (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 Cf. A077800.
%Y Cf. A001359, A111950, A087641.
%Y Cf. A035789, A035790, A035791, A035792, A035793, A035794, A035795.
%K easy,nonn
%O 1,2
%A _Franz Vrabec_, Jun 27 2010
%E More terms from _M. F. Hasler_, May 04 2015
|