%I #22 Sep 11 2024 22:49:00
%S 30,42,66,70,78,102,105,110,114,130,138,154,165,170,174,182,186,190,
%T 195,210,222,230,231,238,246,255,258,266,273,282,285,286,290,310,318,
%U 322,330,345,354,357,366,370,374,385,390,399,402,406,410,418,426,429,430
%N Products of three or more distinct prime numbers.
%C First differs from A336568 in lacking 420.
%H Michael De Vlieger, <a href="/A350352/b350352.txt">Table of n, a(n) for n = 1..10000</a>
%e The terms and their prime indices begin:
%e 30: {1,2,3} 182: {1,4,6} 285: {2,3,8}
%e 42: {1,2,4} 186: {1,2,11} 286: {1,5,6}
%e 66: {1,2,5} 190: {1,3,8} 290: {1,3,10}
%e 70: {1,3,4} 195: {2,3,6} 310: {1,3,11}
%e 78: {1,2,6} 210: {1,2,3,4} 318: {1,2,16}
%e 102: {1,2,7} 222: {1,2,12} 322: {1,4,9}
%e 105: {2,3,4} 230: {1,3,9} 330: {1,2,3,5}
%e 110: {1,3,5} 231: {2,4,5} 345: {2,3,9}
%e 114: {1,2,8} 238: {1,4,7} 354: {1,2,17}
%e 130: {1,3,6} 246: {1,2,13} 357: {2,4,7}
%e 138: {1,2,9} 255: {2,3,7} 366: {1,2,18}
%e 154: {1,4,5} 258: {1,2,14} 370: {1,3,12}
%e 165: {2,3,5} 266: {1,4,8} 374: {1,5,7}
%e 170: {1,3,7} 273: {2,4,6} 385: {3,4,5}
%e 174: {1,2,10} 282: {1,2,15} 390: {1,2,3,6}
%t Select[Range[100],SquareFreeQ[#]&&PrimeOmega[#]>=3&]
%o (Python)
%o from sympy import factorint
%o def ok(n): f = factorint(n, multiple=True); return len(f) == len(set(f)) > 2
%o print([k for k in range(431) if ok(k)]) # _Michael S. Branicky_, Jan 14 2022
%o (Python)
%o from math import isqrt, prod
%o from sympy import primerange, integer_nthroot, primepi
%o def A350352(n):
%o def g(x,a,b,c,m): yield from (((d,) for d in enumerate(primerange(b+1,isqrt(x//c)+1),a+1)) if m==2 else (((a2,b2),)+d for a2,b2 in enumerate(primerange(b+1,integer_nthroot(x//c,m)[0]+1),a+1) for d in g(x,a2,b2,c*b2,m-1)))
%o def f(x): return int(n+x-sum(sum(primepi(x//prod(c[1] for c in a))-a[-1][0] for a in g(x,0,1,1,i)) for i in range(3,x.bit_length())))
%o def bisection(f,kmin=0,kmax=1):
%o while f(kmax) > kmax: kmax <<= 1
%o while kmax-kmin > 1:
%o kmid = kmax+kmin>>1
%o if f(kmid) <= kmid:
%o kmax = kmid
%o else:
%o kmin = kmid
%o return kmax
%o return bisection(f,n,n) # _Chai Wah Wu_, Sep 11 2024
%o (PARI) is(n,f=factor(n))=my(e=f[,2]); #e>2 && vecmax(e)==1 \\ _Charles R Greathouse IV_, Jul 08 2022
%o (PARI) list(lim)=my(v=List()); forsquarefree(n=30,lim\1, if(#n[2][,2]>2, listput(v,n[1]))); Vec(v) \\ _Charles R Greathouse IV_, Jul 08 2022
%Y This is the squarefree case of A033942.
%Y Including squarefree semiprimes gives A120944.
%Y The squarefree complement consists of 1 and A167171.
%Y These are the Heinz numbers of the partitions counted by A347548.
%Y A000040 lists prime numbers (exactly 1 prime factor).
%Y A005117 lists squarefree numbers.
%Y A006881 lists squarefree numbers with exactly 2 prime factors.
%Y A007304 lists squarefree numbers with exactly 3 prime factors.
%Y A046386 lists squarefree numbers with exactly 4 prime factors.
%Y Cf. A000009, A000111, A001250, A002808, A027383, A349796.
%K nonn
%O 1,1
%A _Gus Wiseman_, Jan 11 2022