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.

A085987 Product of exactly four primes, three of which are distinct (p^2*q*r).

Original entry on oeis.org

60, 84, 90, 126, 132, 140, 150, 156, 198, 204, 220, 228, 234, 260, 276, 294, 306, 308, 315, 340, 342, 348, 350, 364, 372, 380, 414, 444, 460, 476, 490, 492, 495, 516, 522, 525, 532, 550, 558, 564, 572, 580, 585, 620, 636, 644, 650, 666, 693, 708, 726
Offset: 1

Views

Author

Alford Arnold, Jul 08 2003

Keywords

Comments

A014613 is completely determined by A030514, A065036, A085986, A085987 and A046386 since p(4) = 5. (cf. A000041). More generally, the first term of sequences which completely determine the k-almost primes can be found in A036035 (a resorted version of A025487).
A050326(a(n)) = 4. - Reinhard Zumkeller, May 03 2013

Examples

			a(1) = 60 since 60 = 2*2*3*5 and has three distinct prime factors.
		

Crossrefs

Programs

  • Mathematica
    f[n_]:=Sort[Last/@FactorInteger[n]]=={1,1,2}; Select[Range[2000], f] (* Vladimir Joseph Stephan Orlovsky, May 03 2011 *)
    pefp[{a_,b_,c_}]:={a^2 b c,a b^2 c,a b c^2}; Module[{upto=800},Select[ Flatten[ pefp/@Subsets[Prime[Range[PrimePi[upto/6]]],{3}]]//Union,#<= upto&]] (* Harvey P. Dale, Oct 02 2018 *)
  • PARI
    list(lim)=my(v=List(),t,x,y,z);forprime(p=2,lim^(1/4),t=lim\p^2;forprime(q=p+1,sqrtint(t),forprime(r=q+1,t\q,x=p^2*q*r;y=p*q^2*r;listput(v,x);if(y<=lim,listput(v,y);z=p*q*r^2;if(z<=lim,listput(v,z))))));vecsort(Vec(v)) \\ Charles R Greathouse IV, Jul 15 2011
    
  • PARI
    is(n)=vecsort(factor(n)[,2]~)==[1,1,2] \\ Charles R Greathouse IV, Oct 19 2015
    
  • Python
    from math import isqrt
    from sympy import primepi, primerange, integer_nthroot
    def A085987(n):
        def bisection(f,kmin=0,kmax=1):
            while f(kmax) > kmax: kmax <<= 1
            kmin = kmax >> 1
            while kmax-kmin > 1:
                kmid = kmax+kmin>>1
                if f(kmid) <= kmid:
                    kmax = kmid
                else:
                    kmin = kmid
            return kmax
        def f(x): return n+x+sum((t:=primepi(s:=isqrt(y:=x//r**2)))+(t*(t-1)>>1)-sum(primepi(y//k) for k in primerange(1, s+1)) for r in primerange(isqrt(x)+1))+sum(primepi(x//p**3) for p in primerange(integer_nthroot(x,3)[0]+1))-primepi(integer_nthroot(x,4)[0])
        return bisection(f,n,n) # Chai Wah Wu, Mar 27 2025

Extensions

More terms from Reinhard Zumkeller, Jul 25 2003