login
Products of exactly 5 distinct primes.
36

%I #36 Aug 31 2024 01:57:33

%S 2310,2730,3570,3990,4290,4830,5610,6006,6090,6270,6510,6630,7410,

%T 7590,7770,7854,8610,8778,8970,9030,9282,9570,9690,9870,10010,10230,

%U 10374,10626,11130,11310,11730,12090,12210,12390,12558,12810,13090,13110

%N Products of exactly 5 distinct primes.

%C Subsequence of A051270. 4620 = 2^2*3*5*7*11 is in A051270 but not in here, for example. - _R. J. Mathar_, Nov 10 2014

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

%e a(1) = 2310 = 2 * 3 * 5 * 7 * 11 = A002110(5) = 5#.

%e a(2) = 2730 = 2 * 3 * 5 * 7 * 13.

%e a(3) = 3570 = 2 * 3 * 5 * 7 * 17.

%e a(10) = 6006 = 2 * 3 * 7 * 11 * 13.

%p A046387 := proc(n)

%p option remember;

%p local a;

%p if n = 1 then

%p 2*3*5*7*11 ;

%p else

%p for a from procname(n-1)+1 do

%p if A001221(a)= 5 and issqrfree(a) then

%p return a;

%p end if;

%p end do:

%p end if;

%p end proc: # _R. J. Mathar_, Oct 13 2019

%t f5Q[n_]:=Last/@FactorInteger[n]=={1, 1, 1, 1, 1}; lst={};Do[If[f5Q[n], AppendTo[lst, n]], {n, 8!}];lst (* _Vladimir Joseph Stephan Orlovsky_, Aug 26 2008 *)

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

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

%o (Python)

%o from math import isqrt, prod

%o from sympy import primerange, integer_nthroot, primepi

%o def A046387(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(primepi(x//prod(c[1] for c in a))-a[-1][0] for a in g(x,0,1,1,5)))

%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 30 2024

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

%Y Cf. A000040, A000961, A001221, A005117, A000977, A002110, A006881, A007304, A007774, A033992, A033993, A046386.

%Y Cf. A014614, A046403, A051270.

%K easy,nonn

%O 1,1

%A _Patrick De Geest_, Jun 15 1998

%E Entry revised by _N. J. A. Sloane_, Apr 10 2006