Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #11 Sep 12 2024 19:57:34
%S 1,11,10,12,16,108,144,128,1296,1152,1024,10368,10240,12288,16384,
%T 110592,147456,131072,1327104,1179648,1048576,10616832,10485760,
%U 12582912,16777216,113246208,100663296,134217728,1006632960,1207959552
%N Smallest number beginning with 1 and having exactly n prime divisors counted with multiplicity.
%H Robert Israel, <a href="/A106421/b106421.txt">Table of n, a(n) for n = 0..3302</a>
%e a(0) = 1, a(5) = 108 = 2^2*3^3.
%p f:= proc(n) uses priqueue; local pq, t,p,x,i;
%p initialize(pq);
%p insert([-2^n,2$n],pq);
%p do
%p t:= extract(pq);
%p x:= -t[1];
%p if floor(x/10^ilog10(x)) = 1 then return x fi;
%p p:= nextprime(t[-1]);
%p for i from n+1 to 2 by -1 while t[i] = t[-1] do
%p insert([t[1]*(p/t[-1])^(n+2-i), op(t[2..i-1]),p$(n+2-i)],pq)
%p od;
%p od
%p end proc:
%p f(0):= 1:
%p map(f, [$0..50]); # _Robert Israel_, Sep 06 2024
%o (Python)
%o from itertools import count
%o from math import isqrt, prod
%o from sympy import primerange, integer_nthroot, primepi
%o def A106421(n):
%o if n <= 1: return 1+10*n
%o def g(x,a,b,c,m): yield from (((d,) for d in enumerate(primerange(b,isqrt(x//c)+1),a)) if m==2 else (((a2,b2),)+d for a2,b2 in enumerate(primerange(b,integer_nthroot(x//c,m)[0]+1),a) for d in g(x,a2,b2,c*b2,m-1)))
%o def f(x): return int(sum(primepi(x//prod(c[1] for c in a))-a[-1][0] for a in g(x,0,1,1,n)))
%o for l in count(len(str(1<<n))-1):
%o kmin, kmax = 10**l-1, 2*10**l-1
%o mmin, mmax = f(kmin), f(kmax)
%o if mmax>mmin:
%o while kmax-kmin > 1:
%o kmid = kmax+kmin>>1
%o mmid = f(kmid)
%o if mmid > mmin:
%o kmax, mmax = kmid, mmid
%o else:
%o kmin, mmin = kmid, mmid
%o return kmax # _Chai Wah Wu_, Sep 12 2024
%Y Cf. A077326-A077334, A106411-A106419, A106421-A106429.
%K base,nonn
%O 0,2
%A _Ray Chandler_, May 02 2005