login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

Numbers such that the three numbers before and the three numbers after are squarefree semiprimes.
3

%I #39 Nov 21 2024 06:09:07

%S 216,143100,194760,206136,273420,684900,807660,1373940,1391760,

%T 1516536,1591596,1611000,1774800,1882980,1891764,2046456,2051496,

%U 2163420,2163960,2338056,2359980,2522520,2913840,3108204,4221756,4297320,4334940,4866120,4988880,5108796,5247144,5606244,5996844

%N Numbers such that the three numbers before and the three numbers after are squarefree semiprimes.

%C All numbers in this sequence are divisible by 36. Proof: Suppose k is odd and in this sequence; then either k-1 or k-3 is divisible by 4, creating a contradiction. Suppose k is even, but not divisible by k; then k-2 is divisible by 4, creating a contradiction. Suppose k is not divisible by 3. Then there exists a number j such that 3*j and 3*(j+1) are among squarefree semiprimes surrounding k; one of them is divisible by 6, creating a contradiction. Suppose k is divisible by 3, but not by 9; then one of the squarefree semiprimes k-3 or k+3 is divisible by 9, creating a contradiction.

%C Since each term k is divisible by 36, it follows that (k-3)/3, (k-2)/2, (k+2)/2, and (k+3)/3 are primes. Additionally, none of the six integers nearest to k can be the cube of a prime: for any prime p > 3, p^3 == {+-1, +-17} (mod 36), so only k-1 or k+1 could be the cube of a prime, yet in either of those cases, that cube's two nearest neighbors, p^3 - 1 and p^3 + 1, would both be factorable (i.e., p^3 - 1 = (p^2 + p + 1)*(p - 1) and p^3 + 1 = (p^2 - p + 1)*(p + 1)), and neither would be a semiprime. Thus, since neither k-1 nor k+1 can be the cube of a prime, testing whether each has four divisors (see the Magma code below) is equivalent to testing whether each is a squarefree semiprime. - _Jon E. Schoenfield_, Nov 26 2023

%C Iannucci (2004-2005) called the three numbers before each term and the three numbers after each term "almost prime triplet twins" (APTTs for short), gave the 6 terms that are smaller than 10^6, and found that there are 882 terms below 10^9. - _Amiram Eldar_, Nov 21 2024

%H Jon E. Schoenfield, <a href="/A358657/b358657.txt">Table of n, a(n) for n = 1..10000</a> (first 169 terms from Robert Israel)

%H Douglas E. Iannucci, <a href="https://www.proquest.com/docview/89065926">Almost prime twin prime triplet twins</a>, Journal of Recreational Mathematics, Vol. 33, No. 2 (2004-2005), pp. 125-129.

%F a(n) = 2*(A158476(n) + 1). - _Hugo Pfoertner_, Dec 12 2022

%e The following numbers are squarefree semiprimes: 213 = 3*71, 214 = 2*107, 215 = 5*43, 217 = 7*31, 218 = 2*109, and 219 = 3*73. Thus, 216 is in this sequence.

%p N:= 10^6: # for terms <= N

%p P:= select(isprime, [2,seq(i,i=3..N/2,2)]):

%p S:= NULL:

%p for i from 1 to nops(P) do

%p p:= P[i];

%p r:= ListTools:-BinaryPlace(P,N/p);

%p if r <= i then break fi;

%p S:= S, op(p * P[i+1 .. r]);

%p od:

%p S:= sort([S]):

%p J:= select(t -> S[t+5] = S[t]+6, [$1..nops(S)-5]):

%p map(t -> S[t+2]+1, J); # _Robert Israel_, Nov 26 2023

%t Select[Range[10000000],Transpose[FactorInteger[# - 3]][[2]] == {1, 1} && Transpose[FactorInteger[# - 2]][[2]] == {1, 1} && Transpose[FactorInteger[# - 1]][[2]] == {1, 1} && Transpose[FactorInteger[# + 3]][[2]] == {1, 1} && Transpose[FactorInteger[# + 2]][[2]] == {1, 1} && Transpose[FactorInteger[# + 1]][[2]] == {1, 1} &]

%t 36*Flatten@Position[({1, 1}==Last@Transpose@FactorInteger@# &/@ {#-3,#-2,#-1,#+1,#+2,#+3}) & /@ (36*Range@(10^6)), {True ..}] (* _Hans Rudolf Widmer_, Aug 01 2024 *)

%o (Python)

%o from itertools import count, islice

%o from sympy import isprime, factorint

%o def issfsemiprime(n): return list(factorint(n).values()) == [1, 1] if n&1 else isprime(n//2)

%o def ok(n): return all(issfsemiprime(n+i) for i in (-2, 2, -3, -1, 1, 3))

%o def agen(): yield from (k for k in count(36, 36) if ok(k))

%o print(list(islice(agen(), 20))) # _Michael S. Branicky_, Nov 26 2022

%o (Magma)

%o a:=[];

%o IsP:=IsPrime;

%o Tau:=NumberOfDivisors;

%o for m in [1..170000] do

%o t:=36*m;

%o if IsP((t-3) div 3)

%o and IsP((t+3) div 3)

%o and IsP((t-2) div 2)

%o and IsP((t+2) div 2)

%o and Tau(t-1) eq 4

%o and Tau(t+1) eq 4 then

%o a:=a cat [t];

%o end if;

%o end for;

%o a; // _Jon E. Schoenfield_, Nov 26 2023

%o (PARI) is(k) = if(k < 4, 0, my(d = [-3, -2, -1, 1, 2, 3]); for(i = 1, #d, if(factor(k+d[i])[,2] != [1,1]~, return(0))); 1); \\ _Amiram Eldar_, Nov 21 2024

%Y Cf. A001358, A158476, A350101, A358666.

%K nonn

%O 1,1

%A _Tanya Khovanova_ and _Massimo Kofler_, Nov 25 2022