A085987 Product of exactly four primes, three of which are distinct (p^2*q*r).
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
Keywords
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
Comments