%I #22 Aug 14 2021 15:40:19
%S 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,
%T 1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,4,4,4,
%U 4,5,5,5,5,5,5,5,5,6,6,6,6,6,6,7,7,7,7,7,7,8,8,8,8,8,8,8,8,8,8,8,8,9,9,9,10
%N a(n) = card{ x <= n : omega(x) = 3 }.
%D G. Tenenbaum, Introduction à la théorie analytique et probabiliste des nombres, p. 203, Publications de l'Institut Cartan, 1990.
%H Daniel Suteu, <a href="/A082998/b082998.txt">Table of n, a(n) for n = 1..10000</a>
%F a(n) ~ (1/2)*(n/log(n))*log(log(n))^2.
%F a(A033992(n)) = n. - _Daniel Suteu_, Jul 21 2021
%o (PARI) a(n)=sum(i=1,n,if(omega(i)-3,0,1))
%o (PARI) a(n, k = 3, m = 1, p = 2, s = sqrtnint(n\m, k), j = 1) = my(count = 0); if (k==2, while(p <= s, my(r = nextprime(p+1)); my(t = m*p); while (t <= n, my(w = n\t); if(r > w, break); count += primepi(w) - j; my(r2 = r); while(r2 <= w, my(u = t*r2*r2); if(u > n, break); while (u <= n, count += 1; u *= r2); r2 = nextprime(r2+1)); t *= p); p = r; j += 1); return(count)); while(p <= s, my(r = nextprime(p+1)); my(t = m*p); while(t <= n, my(s = sqrtnint(n\t, k-1)); if(r > s, break); count += a(n, k-1, t, r, s, j+1); t *= p); p = r; j += 1); count; \\ _Daniel Suteu_, Jul 21 2021
%o (Python)
%o from sympy import factorint
%o from itertools import accumulate
%o def cond(n): return int(len(factorint(n))==3)
%o def aupto(nn): return list(accumulate(map(cond, range(1, nn+1))))
%o print(aupto(105)) # _Michael S. Branicky_, Jul 21 2021
%Y Cf. A001221, A025528, A033992, A072000, A072114, A082997.
%K nonn
%O 1,42
%A _Benoit Cloitre_, May 30 2003