Counting squarefree numbers which have $k$ prime factors? How to find an asymptotic formula for this function below?
$$f(n)=\sum_{pq\leq n}1$$
where $p$ and $q$ are different prime numbers. I guess we can write
$$f(n)=\sum_{p\leq \sqrt{n}}\pi (\frac{n}{p})$$
but i don't know how to proceed after that. And what about the general function?
$$f(k,n)=\sum_{p_{1}p_{2}...p_{k}\leq n}1$$
where $p_{1}, p_{2}, ..., p_{k}$ are different prime numbers.
 A: (edit : I'll try to get an asymptotic formula but I wouldn't be surprised if there are some errors) 
If in $n = \prod_{i=1}^k p_i$ the order of the prime factors counts, with $\delta_P(n)$ indicating the prime localization :
$$h(1,n) = \pi(n) = \sum_{m=1}^n \delta_P(m) = 1 \ast \delta_P(n)\qquad \qquad h(2,n) = \sum_{p \le n} \pi(n/p) = h(1,.) \ast \delta_P(n)$$ 
$$h(k+1,n) = \sum_{p \le n} h(k,n/p) = \sum_{m=1}^n h(k,n/m) \delta_P(m) = h(k,.) \ast \delta_P(n)$$
i.e. with $P(s) = \sum_{p \in \mathcal{P}} p^{-s} = \sum_{n=1}^\infty \delta_P(n) n^{-s} $ :
$$H(1,s) = s\int_1^\infty \pi(x) x^{-s-1} dx = s P(s)$$
$$H(k,s) = H(k-1,s) P(s) = s P(s)^{k} $$
and because when $s \to 1^+$ : $P(s) \sim \ln \zeta(s) \sim \ln(s-1)$ :
$$H(k,s) \sim s (\ln(s-1))^k$$
from which we get the growth rate (with $\ast$ still denoting the multiplicative convolution) :
$$h(k,n) \sim \frac{d}{dx}\underbrace{\displaystyle\frac{x}{\ln x} \ast \ldots \ast \frac{x}{\ln x}}_{k}\ (n)$$
finally, getting from $h(k,n)$ the growth rate of your function $f(k,n)$ counting the number of square-free integers with exactly $k$ prime factors (this time without taking in account the order of the factors) should be a matter of constant :
$$fk,n) \sim C_k h(k,n)$$
with probably $C_k \sim \frac{1}{k!}$
