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.

A106416 Smallest number beginning with 6 that is the product of exactly n distinct primes.

This page as a plain text file.
%I A106416 #11 Sep 27 2024 10:44:58
%S A106416 61,6,66,690,6006,62790,690690,60138078,606996390,6469693230,
%T A106416 600319429710,60007743265470,600277546959090,60039293728424010,
%U A106416 614889782588491410,60865792091025932010,6000526229622444289770
%N A106416 Smallest number beginning with 6 that is the product of exactly n distinct primes.
%H A106416 Chai Wah Wu, <a href="/A106416/b106416.txt">Table of n, a(n) for n = 1..45</a>
%e A106416 a(3) = 66 = 2*3*11.
%o A106416 (Python)
%o A106416 from itertools import count
%o A106416 from math import prod, isqrt
%o A106416 from sympy import primerange, integer_nthroot, primepi, primorial
%o A106416 def A106416(n):
%o A106416     if n == 1: return 61
%o A106416     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 A106416     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 A106416     for l in count(len(str(primorial(n)))-1):
%o A106416         kmin, kmax = 6*10**l-1, 7*10**l-1
%o A106416         mmin, mmax = f(kmin), f(kmax)
%o A106416         if mmax>mmin:
%o A106416             while kmax-kmin > 1:
%o A106416                 kmid = kmax+kmin>>1
%o A106416                 mmid = f(kmid)
%o A106416                 if mmid > mmin:
%o A106416                     kmax, mmax = kmid, mmid
%o A106416                 else:
%o A106416                     kmin, mmin = kmid, mmid
%o A106416     return kmax # _Chai Wah Wu_, Sep 12 2024
%Y A106416 Cf. A077326-A077334, A106411-A106419, A106421-A106429.
%K A106416 base,nonn
%O A106416 1,1
%A A106416 _Ray Chandler_, May 02 2005