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.

A046387 Products of exactly 5 distinct primes.

Original entry on oeis.org

2310, 2730, 3570, 3990, 4290, 4830, 5610, 6006, 6090, 6270, 6510, 6630, 7410, 7590, 7770, 7854, 8610, 8778, 8970, 9030, 9282, 9570, 9690, 9870, 10010, 10230, 10374, 10626, 11130, 11310, 11730, 12090, 12210, 12390, 12558, 12810, 13090, 13110
Offset: 1

Views

Author

Patrick De Geest, Jun 15 1998

Keywords

Comments

Subsequence of A051270. 4620 = 2^2*3*5*7*11 is in A051270 but not in here, for example. - R. J. Mathar, Nov 10 2014

Examples

			a(1) = 2310 = 2 * 3 * 5 * 7 * 11 = A002110(5) = 5#.
a(2) = 2730 = 2 * 3 * 5 * 7 * 13.
a(3) = 3570 = 2 * 3 * 5 * 7 * 17.
a(10) = 6006 = 2 * 3 * 7 * 11 * 13.
		

Crossrefs

Products of exactly k distinct primes, for k = 1 to 6: A000040, A006881. A007304, A046386, A046387, A067885.

Programs

  • Maple
    A046387 := proc(n)
        option remember;
        local a;
        if n = 1 then
            2*3*5*7*11 ;
        else
            for a from procname(n-1)+1 do
                if A001221(a)= 5 and issqrfree(a) then
                    return a;
                end if;
            end do:
        end if;
    end proc: # R. J. Mathar, Oct 13 2019
  • Mathematica
    f5Q[n_]:=Last/@FactorInteger[n]=={1, 1, 1, 1, 1}; lst={};Do[If[f5Q[n], AppendTo[lst, n]], {n, 8!}];lst (* Vladimir Joseph Stephan Orlovsky, Aug 26 2008 *)
  • PARI
    is(n)=factor(n)[,2]==[1,1,1,1,1]~ \\ Charles R Greathouse IV, Sep 17 2015
    
  • PARI
    is(n)= omega(n)==5 && bigomega(n)==5 \\ Hugo Pfoertner, Dec 18 2018
    
  • Python
    from math import isqrt, prod
    from sympy import primerange, integer_nthroot, primepi
    def A046387(n):
        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)))
        def f(x): return int(n+x-sum(primepi(x//prod(c[1] for c in a))-a[-1][0] for a in g(x,0,1,1,5)))
        def bisection(f,kmin=0,kmax=1):
            while f(kmax) > kmax: kmax <<= 1
            while kmax-kmin > 1:
                kmid = kmax+kmin>>1
                if f(kmid) <= kmid:
                    kmax = kmid
                else:
                    kmin = kmid
            return kmax
        return bisection(f) # Chai Wah Wu, Aug 30 2024

Extensions

Entry revised by N. J. A. Sloane, Apr 10 2006