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.

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

This page as a plain text file.
%I A358657 #42 Apr 26 2025 01:44:43
%S A358657 216,143100,194760,206136,273420,684900,807660,1373940,1391760,
%T A358657 1516536,1591596,1611000,1774800,1882980,1891764,2046456,2051496,
%U A358657 2163420,2163960,2338056,2359980,2522520,2913840,3108204,4221756,4297320,4334940,4866120,4988880,5108796,5247144,5606244,5996844
%N A358657 Numbers such that the three numbers before and the three numbers after are squarefree semiprimes.
%C A358657 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 A358657 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 A358657 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 A358657 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 A358657 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 A358657 a(n) = 2*(A158476(n) + 1). - _Hugo Pfoertner_, Dec 12 2022
%e A358657 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 A358657 N:= 10^6: # for terms <= N
%p A358657 P:= select(isprime, [2,seq(i,i=3..N/2,2)]):
%p A358657 S:= NULL:
%p A358657 for i from 1 to nops(P) do
%p A358657   p:= P[i];
%p A358657   r:= ListTools:-BinaryPlace(P,N/p);
%p A358657   if r <= i then break fi;
%p A358657   S:= S, op(p * P[i+1 .. r]);
%p A358657 od:
%p A358657 S:= sort([S]):
%p A358657 J:= select(t -> S[t+5] = S[t]+6, [$1..nops(S)-5]):
%p A358657 map(t -> S[t+2]+1, J); # _Robert Israel_, Nov 26 2023
%t A358657 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 A358657 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 A358657 (Python)
%o A358657 from itertools import count, islice
%o A358657 from sympy import isprime, factorint
%o A358657 def issfsemiprime(n): return list(factorint(n).values()) == [1, 1] if n&1 else isprime(n//2)
%o A358657 def ok(n): return all(issfsemiprime(n+i) for i in (-2, 2, -3, -1, 1, 3))
%o A358657 def agen(): yield from (k for k in count(36, 36) if ok(k))
%o A358657 print(list(islice(agen(), 20))) # _Michael S. Branicky_, Nov 26 2022
%o A358657 (Magma)
%o A358657 a:=[];
%o A358657 IsP:=IsPrime;
%o A358657 Tau:=NumberOfDivisors;
%o A358657 for m in [1..170000] do
%o A358657    t:=36*m;
%o A358657    if IsP((t-3) div 3)
%o A358657          and IsP((t+3) div 3)
%o A358657          and IsP((t-2) div 2)
%o A358657          and IsP((t+2) div 2)
%o A358657          and Tau(t-1) eq 4
%o A358657          and Tau(t+1) eq 4 then
%o A358657       a:=a cat [t];
%o A358657    end if;
%o A358657 end for;
%o A358657 a; // _Jon E. Schoenfield_, Nov 26 2023
%o A358657 (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 A358657 Cf. A001358, A158476, A350101, A358666.
%K A358657 nonn
%O A358657 1,1
%A A358657 _Tanya Khovanova_ and _Massimo Kofler_, Nov 25 2022