I started with the following idea:
- Let $P_k$ be the infinte set of all $k$-almost primes.
- The counting function for $k$-almost primes less than $x$, is $\displaystyle \pi_k(x)\sim\frac{x}{\log x}\frac{(\log \log x)^{k-1}}{(k-1)!}$, where the error goes like $\displaystyle O\left(\frac{x(\log \log x)^{k-2}}{\log x} \right)$. See answer to this MO question.
- The union of all $P_k$ is $\mathbb{N}$ (except $1$), so the counting functions sum up to $\displaystyle \sum_k \pi_k (x)=x$.
I wanted to look at the error term and see how large the discrepancy, between the sum of primes counting functions and natural number couting function (haha!) is. But to my surprise I found the following:
With the series expansion of $\displaystyle e^t=\sum_{m=0}^\infty \frac{t^m}{m!}$, where $t=\log \log x$, we get: $$ \log x = e^{\log \log x}=\sum_{m=1}^\infty\frac{(\log \log x)^{m-1}}{(m-1)!}. $$ Here I used a Taylor series with derivatives w.r.t. to $\log \log x$. We use $\displaystyle \frac{d^me^{\log \log x}}{d(\log \log x)^m}=1$ . Now summing up all $\pi_k(x)$, we have $$ x=\sum_k \pi_k(x) \sim \frac{x}{\log x} \sum_{k=1}^\infty\frac{(\log \log x)^{k-1}}{(k-1)!} =x. $$
Ok, it's correct, but why? Do the error terms all cancel or is this just a artifact of the bad approximation of the counting function $\pi_k(x)$?