cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A106411 Smallest number beginning with 1 that is the product of exactly n distinct primes.

This page as a plain text file.
%I A106411 #8 Sep 12 2024 19:23:43
%S A106411 1,11,10,102,1110,10010,101010,1009470,11741730,1001110110,
%T A106411 10407767370,1000287585570,10293281928930,1001230315195110,
%U A106411 13082761331670030,1004819888620217670,100015003602410826930,1922760350154212639070
%N A106411 Smallest number beginning with 1 that is the product of exactly n distinct primes.
%H A106411 Chai Wah Wu, <a href="/A106411/b106411.txt">Table of n, a(n) for n = 0..45</a>
%e A106411 a(0) = 1, a(5) = 10010 = 2*5*7*11*13.
%o A106411 (Python)
%o A106411 from itertools import count
%o A106411 from math import prod, isqrt
%o A106411 from sympy import primerange, integer_nthroot, primepi, primorial
%o A106411 def A106411(n):
%o A106411     if n <= 1: return 1+10*n
%o A106411     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 A106411     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 A106411     for l in count(len(str(primorial(n)))-1):
%o A106411         kmin, kmax = 10**l-1, 2*10**l-1
%o A106411         mmin, mmax = f(kmin), f(kmax)
%o A106411         if mmax>mmin:
%o A106411             while kmax-kmin > 1:
%o A106411                 kmid = kmax+kmin>>1
%o A106411                 mmid = f(kmid)
%o A106411                 if mmid > mmin:
%o A106411                     kmax, mmax = kmid, mmid
%o A106411                 else:
%o A106411                     kmin, mmin = kmid, mmid
%o A106411     return kmax # _Chai Wah Wu_, Sep 12 2024
%Y A106411 Cf. A077326-A077334, A106411-A106419, A106421-A106429.
%K A106411 base,nonn
%O A106411 0,2
%A A106411 _Ray Chandler_, May 02 2005