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.

A106428 Smallest number beginning with 8 and having exactly n prime divisors counted with multiplicity.

This page as a plain text file.
%I A106428 #7 Sep 12 2024 19:22:21
%S A106428 83,82,8,81,80,810,800,864,8000,8064,80000,80640,8192,82944,81920,
%T A106428 802816,819200,884736,8126464,8257536,80621568,80216064,8388608,
%U A106428 84934656,83886080,822083584,838860800,8120172544,805306368,8153726976
%N A106428 Smallest number beginning with 8 and having exactly n prime divisors counted with multiplicity.
%e A106428 a(3) = 8 = 2^3.
%o A106428 (Python)
%o A106428 from itertools import count
%o A106428 from math import isqrt, prod
%o A106428 from sympy import primerange, integer_nthroot, primepi
%o A106428 def A106428(n):
%o A106428     if n == 1: return 83
%o A106428     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 A106428     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 A106428     for l in count(len(str(1<<n))-1):
%o A106428         kmin, kmax = 8*10**l-1, 9*10**l-1
%o A106428         mmin, mmax = f(kmin), f(kmax)
%o A106428         if mmax>mmin:
%o A106428             while kmax-kmin > 1:
%o A106428                 kmid = kmax+kmin>>1
%o A106428                 mmid = f(kmid)
%o A106428                 if mmid > mmin:
%o A106428                     kmax, mmax = kmid, mmid
%o A106428                 else:
%o A106428                     kmin, mmin = kmid, mmid
%o A106428     return kmax # _Chai Wah Wu_, Sep 12 2024
%Y A106428 Cf. A077326-A077334, A106411-A106419, A106421-A106429.
%K A106428 base,nonn
%O A106428 1,1
%A A106428 _Ray Chandler_, May 02 2005