|
|
A082997
|
|
a(n) = card{ x <= n : omega(x) = 2 }.
|
|
6
|
|
|
0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 3, 3, 4, 5, 5, 5, 6, 6, 7, 8, 9, 9, 10, 10, 11, 11, 12, 12, 12, 12, 12, 13, 14, 15, 16, 16, 17, 18, 19, 19, 19, 19, 20, 21, 22, 22, 23, 23, 24, 25, 26, 26, 27, 28, 29, 30, 31, 31, 31, 31, 32, 33, 33, 34, 34, 34, 35, 36, 36, 36, 37, 37, 38, 39, 40, 41
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,10
|
|
REFERENCES
|
G. Tenenbaum, Introduction à la théorie analytique et probabiliste des nombres, p. 203, Publications de l'Institut Cartan, 1990.
|
|
LINKS
|
|
|
FORMULA
|
a(n) ~ (n/log(n))*log(log(n)).
|
|
MAPLE
|
a:= proc(n) option remember; `if`(n=0, 0,
a(n-1)+`if`(nops(ifactors(n)[2])=2, 1, 0))
end:
|
|
MATHEMATICA
|
a[n_] := Count[PrimeNu[Range[n]], 2];
|
|
PROG
|
(PARI) a(n)=sum(i=1, n, if(omega(i)-2, 0, 1))
(PARI) a(n) = my(s = sqrtint(n), p = 2, j = 1, count = 0); while(p <= s, my(r = nextprime(p+1)); my(t = 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); count; \\ Daniel Suteu, Jul 21 2021
(Python)
from sympy import factorint
from itertools import accumulate
def cond(n): return int(len(factorint(n))==2)
def aupto(nn): return list(accumulate(map(cond, range(1, nn+1))))
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|