OFFSET
1,1
COMMENTS
The old name was "Odd numbers with exactly 3 distinct prime factors", which is slightly ambiguous, since it might be interpreted to include 315 = 3^2*5*7. Cf. A278569. - N. J. A. Sloane, Nov 27 2016
LINKS
T. D. Noe, Table of n, a(n) for n=1..1000
MATHEMATICA
f[n_] := OddQ[n] && Last/@FactorInteger[n]=={1, 1, 1}; lst={}; Do[If[f[n], AppendTo[lst, n]], {n, 2000}]; lst (* Vladimir Joseph Stephan Orlovsky, Nov 23 2009 *)
PROG
(PARI) list(lim)=my(v=List(), t); forprime(p=3, lim^(1/3), forprime(q=p+1, sqrt(lim\p), t=p*q; forprime(r=q+1, lim\t, listput(v, t*r)))); vecsort(Vec(v)) \\ Charles R Greathouse IV, Jul 26 2011
(Python)
from math import isqrt
from sympy import primepi, integer_nthroot, primerange
def A046389(n):
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
def f(x): return int(n+x-sum(primepi(x//(k*m))-b for a, k in enumerate(primerange(3, integer_nthroot(x, 3)[0]+1), 2) for b, m in enumerate(primerange(k+1, isqrt(x//k)+1), a+1)))
return bisection(f, n, n) # Chai Wah Wu, Sep 10 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
Patrick De Geest, Jun 15 1998
EXTENSIONS
Name clarified by N. J. A. Sloane, Nov 27 2016
STATUS
approved