A358666 Numbers such that the two numbers before and the two numbers after are squarefree semiprimes.
144, 204, 216, 300, 696, 1140, 1764, 2604, 3240, 3900, 4536, 4764, 5316, 5460, 6000, 6504, 7116, 7836, 7860, 8004, 8484, 9300, 9864, 9936, 10020, 11760, 12180, 13140, 13656, 14256, 15096, 16020, 16440, 16860, 18000, 19536, 20016, 20136, 20280, 21780, 22116, 22236, 23940
Offset: 1
Keywords
Examples
The following numbers are squarefree semiprimes: 214 = 2*107, 215 = 5*43, 217 = 7*31, and 218 = 2*109. Thus, 216 is in this sequence.
Programs
-
Mathematica
Select[Range[100000], Transpose[FactorInteger[# - 2]][[2]] == {1, 1} && Transpose[FactorInteger[# - 1]][[2]] == {1, 1} && Transpose[FactorInteger[# + 2]][[2]] == {1, 1} && Transpose[FactorInteger[# + 1]][[2]] == {1, 1} &]
-
Python
from itertools import count, islice from sympy import isprime, factorint def issfsemiprime(n): return list(factorint(n).values()) == [1, 1] if n&1 else isprime(n//2) def ok(n): return all(issfsemiprime(n+i) for i in (-2, 2, -1, 1)) def agen(): yield from (k for k in count(12, 12) if ok(k)) print(list(islice(agen(), 43))) # Michael S. Branicky, Nov 26 2022
Comments