login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

Primes p such that both p+2 and p-2 are neither prime nor semiprime.
1

%I #26 Nov 26 2020 07:48:02

%S 173,277,457,607,727,929,1087,1129,1181,1223,1237,1307,1423,1433,1447,

%T 1493,1523,1549,1597,1613,1627,1811,1861,1973,2011,2063,2137,2297,

%U 2347,2377,2399,2423,2677,2693,2753,2767,2797,2819,2851,2917,3023,3313,3323,3449

%N Primes p such that both p+2 and p-2 are neither prime nor semiprime.

%C Also: Primes p such that both p+2 and p-2 have at least three prime divisors. - _David A. Corneth_, Dec 28 2018

%H Alois P. Heinz, <a href="/A322842/b322842.txt">Table of n, a(n) for n = 1..10000</a>

%p q:= n-> numtheory[bigomega](n)>2:

%p a:= proc(n) option remember; local p;

%p p:= `if`(n=1, 1, a(n-1));

%p do p:= nextprime(p);

%p if q(p-2) and q(p+2) then break fi

%p od; p

%p end:

%p seq(a(n), n=1..50); # _Alois P. Heinz_, Dec 28 2018

%t Select[Prime[Range[1000]], PrimeOmega[#-2] > 2 && PrimeOmega[#+2] > 2&] (* _Jean-François Alcover_, Nov 26 2020 *)

%o (Java)

%o boolean isIsolatedPrime(int num){

%o int upper = num + 2;

%o int lower = num - 2;

%o return isPrime(num) &&

%o !isPrime(upper) &&

%o !isPrime(lower) &&

%o !isSemiPrime(upper) &&

%o !isSemiPrime(lower);

%o }

%o (PARI) is(n) = isprime(n) && bigomega(n + 2) > 2 && bigomega(n - 2) > 2 \\ _David A. Corneth_, Dec 28 2018

%Y Cf. A000040, A001358, A007510, A134797.

%K nonn

%O 1,1

%A _Kyle Buscaglia_, Cory Baker, Dec 28 2018