OFFSET
1,1
COMMENTS
a(1) = 149 is the first prime separated from its previous prime (139) by a composite number (9) of successive composites, namely, 148, 147, 146, 145, 144, 143, 142, 141, 140.
Primes p such that nextprime(p) - p - 1 is composite. - Jahangeer Kholdi, Nov 27 2014
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..1000
MAPLE
N:= 3000: # to get all entries <= N
Primes:= select(isprime, [seq(2*i+1, i=1..(N-1)/2)]):
Q:= map(t -> (t>2) and not isprime(t-1), Primes[2..-1] - Primes[1..-2]):
zip(proc(p, q) if q then p else NULL fi end proc, Primes[2..-1], Q); # Robert Israel, Nov 28 2014
MATHEMATICA
ps = Prime[Range[500]]; pos = Position[Differences[ps] - 1, _?(# > 1 && ! PrimeQ[#] &)]; ps[[Flatten[pos + 1]]] (* T. D. Noe, Mar 21 2012 *)
Transpose[Select[Partition[Prime[Range[400]], 2, 1], CompositeQ[#[[2]] - #[[1]] - 1] &]][[2]] (* Harvey P. Dale, Aug 05 2014 *)
Select[Prime[Range[375]], NextPrime[#] - # - 1 > 1 && !PrimeQ[NextPrime[#] - # - 1] &] (* Jahangeer Kholdi, Nov 27 2014 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Lekraj Beedassy, Mar 21 2012
STATUS
approved