OFFSET
1,1
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 1..10000
EXAMPLE
a(1)=23 is the first prime separated both from its previous prime neighbor (19) and next prime neighbor (29) by a prime number (respectively 3 and 5) of composites: [19], 20, 21, 22, [23], 24, 25, 26, 27, 28, [29].
MATHEMATICA
d = Differences[Prime[Range[200]]] - 1; t = {}; Do[If[PrimeQ[d[[i - 1]]] && PrimeQ[d[[i]]], AppendTo[t, Prime[i]]], {i, 2, Length[d]}]; t (* T. D. Noe, Mar 18 2012 *)
PROG
(PARI) list(lim)=my(v=List(), p=2, q=3); forprime(r=5, nextprime(lim\1+1), if(isprime(q-p-1) && isprime(r-q-1), listput(v, q)); p=q; q=r); Vec(v) \\ Charles R Greathouse IV, Apr 30 2016
CROSSREFS
KEYWORD
nonn
AUTHOR
Lekraj Beedassy, Mar 12 2012
STATUS
approved