login

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”).

Smallest number beginning with 9 and having exactly n prime divisors counted with multiplicity.
28

%I #11 Aug 30 2024 02:54:45

%S 97,9,92,90,918,96,972,960,9072,9600,90624,9216,93312,90112,903168,

%T 98304,995328,917504,9043968,9175040,90243072,9437184,95551488,

%U 92274688,924844032,922746880,9042919424,905969664,9172942848,9059696640

%N Smallest number beginning with 9 and having exactly n prime divisors counted with multiplicity.

%e a(2) = 9 = 3^2.

%o (PARI) a(n) = {i = 2^n; while ((digits(i)[1] != 9) || (bigomega(i)!=n), i++); i;} \\ _Michel Marcus_, Sep 14 2013

%o (Python)

%o from itertools import count

%o from math import isqrt, prod

%o from sympy import primerange, integer_nthroot, primepi

%o def A106429(n):

%o if n == 1: return 97

%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 = 9*10**l-1, 10**(l+1)-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_, Aug 29 2024

%Y Cf. A077326-A077334, A106411-A106419, A106421-A106429.

%K base,nonn

%O 1,1

%A _Ray Chandler_, May 02 2005