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.

A106427 Smallest number beginning with 7 and having exactly n prime divisors counted with multiplicity.

This page as a plain text file.
%I A106427 #7 Sep 12 2024 19:22:49
%S A106427 7,74,70,708,72,729,704,7056,768,7776,7168,70656,71680,702464,73728,
%T A106427 746496,720896,7225344,786432,7962624,7077888,71663616,70778880,
%U A106427 700710912,75497472,764411904,704643072,7113539584,7046430720
%N A106427 Smallest number beginning with 7 and having exactly n prime divisors counted with multiplicity.
%e A106427 a(3) = 70 = 2*5*7.
%o A106427 (Python)
%o A106427 from itertools import count
%o A106427 from math import isqrt, prod
%o A106427 from sympy import primerange, integer_nthroot, primepi
%o A106427 def A106427(n):
%o A106427     if n == 1: return 7
%o A106427     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 A106427     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 A106427     for l in count(len(str(1<<n))-1):
%o A106427         kmin, kmax = 7*10**l-1, 8*10**l-1
%o A106427         mmin, mmax = f(kmin), f(kmax)
%o A106427         if mmax>mmin:
%o A106427             while kmax-kmin > 1:
%o A106427                 kmid = kmax+kmin>>1
%o A106427                 mmid = f(kmid)
%o A106427                 if mmid > mmin:
%o A106427                     kmax, mmax = kmid, mmid
%o A106427                 else:
%o A106427                     kmin, mmin = kmid, mmid
%o A106427     return kmax # _Chai Wah Wu_, Sep 12 2024
%Y A106427 Cf. A077326-A077334, A106411-A106419, A106421-A106429.
%K A106427 base,nonn
%O A106427 1,1
%A A106427 _Ray Chandler_, May 02 2005