OFFSET
1,1
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
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 prime and the next primes are 149,151.
MAPLE
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
CROSSREFS
KEYWORD
nonn
AUTHOR
Neil Fernandez, Mar 23 2002
STATUS
approved