login
Squarefree numbers excluding twin primes.
0

%I #23 Oct 04 2021 08:55:10

%S 1,2,6,10,14,15,21,22,23,26,30,33,34,35,37,38,39,42,46,47,51,53,55,57,

%T 58,62,65,66,67,69,70,74,77,78,79,82,83,85,86,87,89,91,93,94,95,97,

%U 102,105,106,110,111,113,114,115,118,119,122,123

%N Squarefree numbers excluding twin primes.

%e 30 is a term because: 30 = 2*3*5 is squarefree and is not a member of a twin primes pair.

%t Select[Range@ 123, SquareFreeQ@ # && ! And[PrimeQ@ #, Total@ Boole@ PrimeQ[# + {-2, 2}] >= 1] &] (* _Michael De Vlieger_, Feb 04 2017 *)

%o (PARI) {

%o for(n=1,1000,

%o mb=moebius(n);

%o if(mb<>0,

%o if(isprime(n),

%o if(!isprime(n-2)&&!isprime(n+2),

%o print1(n", ")

%o ),

%o ;print1(n", ")

%o )

%o )

%o )

%o }

%Y Cf. A005117 (squarefree numbers), A001097 (twin primes), A065421 (Brun's constant).

%K nonn

%O 1,2

%A _Dimitris Valianatos_, Feb 03 2017