%I #23 Jan 27 2019 19:38:19
%S 15,21,33,35,39,51,55,57,65,77,85,87,91,93,95,105,119,123,129,133,143,
%T 145,155,165,177,183,187,195,203,205,209,213,215,217,219,221,231,247,
%U 255,273,285,287,295,301,303,305,309,319,321,323,327,341,355,357,365
%N Squarefree odd composite numbers whose factors are all twin primes (not necessarily from the same pair).
%C This sequence has infinitely many terms if and only if the twin prime conjecture is true.
%H Robert Israel, <a href="/A321644/b321644.txt">Table of n, a(n) for n = 1..10000</a>
%e a(3) = 33 = 3 * 11; 3 and 11 are both twin primes, but not from the same pair.
%p N:= 1000: # to get all terms <= N
%p P:= select(isprime, {seq(i,i=3..(N+6)/3,2)}):
%p TP:= P intersect map(`-`,P,2):
%p TP:= TP union map(`+`,TP,2):
%p Agenda:= map(t -> [t],TP): Res:= NULL:
%p while Agenda <> {} do
%p Agenda:= map(proc(t) local s; seq([op(t),s], s = select(s -> s > t[-1] and s*convert(t,`*`) <= N , TP)) end proc, Agenda);
%p Res:= Res, op(map(convert,Agenda,`*`));
%p od:
%p sort([Res]); # _Robert Israel_, Jan 27 2019
%t seqQ[n_] := CompositeQ[n] && SquareFreeQ[n] && Module[{f = FactorInteger[n][[;;, 1]]}, Length[Select[f, PrimeQ[# - 2] || PrimeQ[# + 2] &]] == Length[f]]; Select[ Range[1, 365, 2], seqQ] (* _Amiram Eldar_, Nov 15 2018 *)
%o (PARI) {forcomposite(n=3, 1000, if(moebius(n) <> 0, v = factor(n)~; i = 0;for(k = 1, #v,p=v[1,k]; if(isprime(p-2)||isprime(p+2), i++));if(i==#v,print1(n", "))))}
%Y Subsequence of A024556, and hence of A056911, A061346, and A071904.
%Y Cf. A001097.
%K nonn,easy
%O 1,1
%A _Dimitris Valianatos_, Nov 15 2018