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”).
%I #34 Sep 08 2022 08:46:23
%S 37,67,79,97,127,157,163,211,223,257,277,307,317,331,337,353,367,373,
%T 379,389,397,401,409,439,449,457,487,499,541,547,557,577,607,613,631,
%U 647,673,677,691,701,709,727,733,739,751,757,769,773,787,797,853,877,907,919,929,937,941,947,967,971,977,991,997
%N Primes that are neither a twin prime nor a Sophie Germain or safe prime.
%H Amiram Eldar, <a href="/A319673/b319673.txt">Table of n, a(n) for n = 1..10000</a>
%F A000040\(A001097 U A005384 U A005385).
%e 37 is prime, but it is not a twin prime (neither 35 nor 39 are prime), it is not a Sophie Germain prime (2*37 + 1 = 75 is not prime), and it is not a safe prime ((37 - 1)/2 = 18 is not prime). So 37 is in the sequence.
%p select(p->isprime(p) and not isprime(p-2) and not isprime(p+2) and not isprime(2*p+1) and not isprime((p-1)/2),[$1..1000]); # _Muniru A Asiru_, Sep 27 2018
%t Select[Prime@ Range@ PrimePi[10^3], NoneTrue[{# - 2, # + 2, 2 # + 1, (# - 1)/2}, PrimeQ] &] (* _Michael De Vlieger_, Sep 26 2018 *)
%o (PARI) isok(p) = isprime(p) && !isprime(p-2) && !isprime(p+2) && !isprime(2*p+1) && !isprime((p-1)/2); \\ _Michel Marcus_, Sep 26 2018
%o (GAP) Filtered([1..1000],p->IsPrime(p) and not IsPrime(p-2) and not IsPrime(p+2) and not IsPrime(2*p+1) and not IsPrime((p-1)/2)); # _Muniru A Asiru_, Sep 27 2018
%o (Magma) [p: p in PrimesUpTo(1000) | not IsPrime(p-2) and not IsPrime(p+2)and not IsPrime(2*p+1)and not IsPrime((p-1) div 2)]; // _Vincenzo Librandi_, Ocy 25 2018
%Y Cf. A000040, A001097, A005384, A005385.
%K nonn
%O 1,1
%A _Ralf Steiner_, Sep 25 2018