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.

A106422 Smallest number beginning with 2 and having exactly n prime divisors counted with multiplicity.

This page as a plain text file.
%I A106422 #11 Apr 17 2025 09:50:44
%S A106422 2,21,20,24,200,216,288,256,2592,2304,2048,20736,20480,24576,204800,
%T A106422 221184,294912,262144,2654208,2359296,2097152,21233664,20971520,
%U A106422 25165824,209715200,226492416,201326592,268435456,2013265920,2415919104
%N A106422 Smallest number beginning with 2 and having exactly n prime divisors counted with multiplicity.
%H A106422 Robert Israel, <a href="/A106422/b106422.txt">Table of n, a(n) for n = 1..3303</a>
%e A106422 a(1) = 2, a(5) = 200 = 2^3*5^2.
%p A106422 f:= proc(n) uses priqueue; local pq, t, p, x, i;
%p A106422     initialize(pq);
%p A106422     insert([-2^n, 2$n], pq);
%p A106422     do
%p A106422       t:= extract(pq);
%p A106422       x:= -t[1];
%p A106422       if floor(x/10^ilog10(x)) = 2 then return x fi;
%p A106422       p:= nextprime(t[-1]);
%p A106422       for i from n+1 to 2 by -1 while t[i] = t[-1] do
%p A106422         insert([t[1]*(p/t[-1])^(n+2-i), op(t[2..i-1]), p$(n+2-i)], pq)
%p A106422       od;
%p A106422     od
%p A106422 end proc:
%p A106422 map(f, [$1..40]); # _Robert Israel_, Apr 15 2025
%o A106422 (Python)
%o A106422 from itertools import count
%o A106422 from math import isqrt, prod
%o A106422 from sympy import primerange, integer_nthroot, primepi
%o A106422 def A106422(n):
%o A106422     if n == 1: return 2
%o A106422     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 A106422     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 A106422     for l in count(len(str(1<<n))-1):
%o A106422         kmin, kmax = 2*10**l-1, 3*10**l-1
%o A106422         mmin, mmax = f(kmin), f(kmax)
%o A106422         if mmax>mmin:
%o A106422             while kmax-kmin > 1:
%o A106422                 kmid = kmax+kmin>>1
%o A106422                 mmid = f(kmid)
%o A106422                 if mmid > mmin:
%o A106422                     kmax, mmax = kmid, mmid
%o A106422                 else:
%o A106422                     kmin, mmin = kmid, mmid
%o A106422     return kmax # _Chai Wah Wu_, Sep 12 2024
%Y A106422 Cf. A077326-A077334, A106411-A106419, A106421-A106429.
%K A106422 base,nonn
%O A106422 1,1
%A A106422 _Ray Chandler_, May 02 2005