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.

A106421 Smallest number beginning with 1 and having exactly n prime divisors counted with multiplicity.

Original entry on oeis.org

1, 11, 10, 12, 16, 108, 144, 128, 1296, 1152, 1024, 10368, 10240, 12288, 16384, 110592, 147456, 131072, 1327104, 1179648, 1048576, 10616832, 10485760, 12582912, 16777216, 113246208, 100663296, 134217728, 1006632960, 1207959552
Offset: 0

Views

Author

Ray Chandler, May 02 2005

Keywords

Examples

			a(0) = 1, a(5) = 108 = 2^2*3^3.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) uses priqueue; local pq, t,p,x,i;
        initialize(pq);
        insert([-2^n,2$n],pq);
        do
          t:= extract(pq);
          x:= -t[1];
          if floor(x/10^ilog10(x)) = 1 then return x fi;
          p:= nextprime(t[-1]);
          for i from n+1 to 2 by -1 while t[i] = t[-1] do
            insert([t[1]*(p/t[-1])^(n+2-i), op(t[2..i-1]),p$(n+2-i)],pq)
          od;
        od
    end proc:
    f(0):= 1:
    map(f, [$0..50]); # Robert Israel, Sep 06 2024
  • Python
    from itertools import count
    from math import isqrt, prod
    from sympy import primerange, integer_nthroot, primepi
    def A106421(n):
        if n <= 1: return 1+10*n
        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)))
        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)))
        for l in count(len(str(1<mmin:
                while kmax-kmin > 1:
                    kmid = kmax+kmin>>1
                    mmid = f(kmid)
                    if mmid > mmin:
                        kmax, mmax = kmid, mmid
                    else:
                        kmin, mmin = kmid, mmid
        return kmax # Chai Wah Wu, Sep 12 2024