cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A321644 Squarefree odd composite numbers whose factors are all twin primes (not necessarily from the same pair).

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