login
Products of exactly four distinct primes.
65

%I #39 Aug 30 2024 02:53:07

%S 210,330,390,462,510,546,570,690,714,770,798,858,870,910,930,966,1110,

%T 1122,1155,1190,1218,1230,1254,1290,1302,1326,1330,1365,1410,1430,

%U 1482,1518,1554,1590,1610,1722,1770,1785,1794,1806,1830,1870,1914,1938,1974

%N Products of exactly four distinct primes.

%C A squarefree subsequence of A033993. Numbers like 420 = 2^2*3*5*7 with at least one prime exponent greater than 1 in the prime signature are excluded here. - _R. J. Mathar_, Apr 03 2011

%C Numbers such that omega(n) = bigomega(n) = 4. - _Michel Marcus_, Dec 15 2015

%H T. D. Noe, <a href="/A046386/b046386.txt">Table of n, a(n) for n = 1..10000</a>

%F Intersection of A014613 (product of 4 primes) and A033993 (divisible by 4 distinct primes). - _M. F. Hasler_, Mar 24 2022

%e 210 = 2*3*5*7;

%e 330 = 2*3*5*11;

%e 390 = 2*3*5*13;

%e 462 = 2*3*7*11.

%t fQ[n_] := Last /@ FactorInteger[n] == {1, 1, 1, 1}; Select[ Range[2000], fQ[ # ] &] (* _Robert G. Wilson v_, Aug 04 2005 *)

%o (PARI) is(n)=factor(n)[,2]==[1,1,1,1]~ \\ _Charles R Greathouse IV_, Sep 17 2015

%o (PARI) is(n) = omega(n)==4 && bigomega(n)==4 \\ _Hugo Pfoertner_, Dec 18 2018

%o (Python)

%o from math import isqrt

%o from sympy import primepi, primerange, integer_nthroot

%o def A046386(n):

%o def f(x): return int(n+x-sum(primepi(x//(k*m*r))-c for a,k in enumerate(primerange(integer_nthroot(x,4)[0]+1),1) for b,m in enumerate(primerange(k+1,integer_nthroot(x//k,3)[0]+1),a+1) for c,r in enumerate(primerange(m+1,isqrt(x//(k*m))+1),b+1)))

%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) # _Chai Wah Wu_, Aug 29 2024

%Y Products of exactly k distinct primes, for k = 1 to 6: A000040, A006881. A007304, A046386, A046387, A067885.

%Y Cf. A001221 (omega), A001222 (bigomega), A014613 (bigomega(N) = 4) and A033993 (omega(N) = 4).

%Y Cf. A046402 (4 palindromic prime factors).

%K nonn,easy

%O 1,1

%A _Patrick De Geest_, Jun 15 1998