A321644 Squarefree odd composite numbers whose factors are all twin primes (not necessarily from the same pair).
15, 21, 33, 35, 39, 51, 55, 57, 65, 77, 85, 87, 91, 93, 95, 105, 119, 123, 129, 133, 143, 145, 155, 165, 177, 183, 187, 195, 203, 205, 209, 213, 215, 217, 219, 221, 231, 247, 255, 273, 285, 287, 295, 301, 303, 305, 309, 319, 321, 323, 327, 341, 355, 357, 365
Offset: 1
Examples
a(3) = 33 = 3 * 11; 3 and 11 are both twin primes, but not from the same pair.
Links
- Robert Israel, Table of n, a(n) for n = 1..10000
Programs
-
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 *)
-
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", "))))}
Comments