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.

A106417 Smallest number beginning with 7 that is the product of exactly n distinct primes.

This page as a plain text file.
%I A106417 #8 Sep 12 2024 19:14:46
%S A106417 7,74,70,714,7410,71610,746130,70387590,703600590,70015935990,
%T A106417 700288518930,7420738134810,701098433345310,70016268785853390,
%U A106417 757887406446280110,70025936403159126390,7001749954335151685670
%N A106417 Smallest number beginning with 7 that is the product of exactly n distinct primes.
%H A106417 Chai Wah Wu, <a href="/A106417/b106417.txt">Table of n, a(n) for n = 1..45</a>
%e A106417 a(3) = 70 = 2*5*7.
%o A106417 (Python)
%o A106417 from itertools import count
%o A106417 from math import prod, isqrt
%o A106417 from sympy import primerange, integer_nthroot, primepi, primorial
%o A106417 def A106417(n):
%o A106417     if n == 1: return 7
%o A106417     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 A106417     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 A106417     for l in count(len(str(primorial(n)))-1):
%o A106417         kmin, kmax = 7*10**l-1, 8*10**l-1
%o A106417         mmin, mmax = f(kmin), f(kmax)
%o A106417         if mmax>mmin:
%o A106417             while kmax-kmin > 1:
%o A106417                 kmid = kmax+kmin>>1
%o A106417                 mmid = f(kmid)
%o A106417                 if mmid > mmin:
%o A106417                     kmax, mmax = kmid, mmid
%o A106417                 else:
%o A106417                     kmin, mmin = kmid, mmid
%o A106417     return kmax # _Chai Wah Wu_, Sep 12 2024
%Y A106417 Cf. A077326-A077334, A106411-A106419, A106421-A106429.
%K A106417 base,nonn
%O A106417 1,1
%A A106417 _Ray Chandler_, May 02 2005