login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Primes p such that neither g-1 nor g+1 is prime, where g is the gap from p to the next prime.
1

%I #11 Jul 13 2022 07:18:13

%S 1327,2477,3137,5531,8467,9973,11213,11743,12011,12163,12347,14897,

%T 16007,16493,16703,17257,19087,20297,20443,21433,24443,26267,26513,

%U 29033,29501,29683,31193,31907,32653,32843,34549,34781,35543,35771,36161,36497,36947,37061,37747,38993,39581,40361,40433

%N Primes p such that neither g-1 nor g+1 is prime, where g is the gap from p to the next prime.

%C Primes prime(i) where A001223(i) is in A061673.

%H Robert Israel, <a href="/A355485/b355485.txt">Table of n, a(n) for n = 1..10000</a>

%e a(3) = 3137 is a term because 3137 is prime, the next prime is 3163 = 3137+26, and neither 26-1 = 25 nor 26+1 = 27 is prime.

%p q:= 2:

%p count:= 0:

%p R:= NULL:

%p while count < 100 do

%p p:= q;

%p q:= nextprime(q);

%p g:= q-p;

%p if not(isprime(g-1) or isprime(g+1)) then

%p count:= count+1;

%p R:= R, p

%p fi

%p od:

%p R;

%o (PARI) isok(p) = if (isprime(p), my(g=nextprime(p+1)-p); !isprime(g-1) && !isprime(g+1)); \\ _Michel Marcus_, Jul 05 2022

%Y Cf. A001223, A061673.

%K nonn

%O 1,1

%A _J. M. Bergot_ and _Robert Israel_, Jul 04 2022