OFFSET
1,1
COMMENTS
This sequence has infinitely many terms if and only if the twin prime conjecture is true.
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
a(3) = 33 = 3 * 11; 3 and 11 are both twin primes, but not from the same pair.
MAPLE
N:= 1000: # to get all terms <= N
P:= select(isprime, {seq(i, i=3..(N+6)/3, 2)}):
TP:= P intersect map(`-`, P, 2):
TP:= TP union map(`+`, TP, 2):
Agenda:= map(t -> [t], TP): Res:= NULL:
while Agenda <> {} do
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);
Res:= Res, op(map(convert, Agenda, `*`));
od:
sort([Res]); # Robert Israel, Jan 27 2019
MATHEMATICA
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 *)
PROG
(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", "))))}
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Dimitris Valianatos, Nov 15 2018
STATUS
approved