Suppose we have set $A=\left\{\frac{1}{k}:k\in\mathbb{N}\right\}$ and we divide interval $[0,1]$ into $n$ sub-intervals of equal length. How do we find the exact forumula (or approximation) of the number sub-intervals $f(n)$ whose intersection with $A$ is non-empty?
Here is what I found
$$\begin{array}{|c|c|} \hline n & f(n) \\ \hline 1 & 1 \\ \hline 2 & 2 \\ \hline 3 & 3 \\ \hline 4 & 4 \\ \hline 5 & 4 \\ \hline 6 & 5 \\ \hline 7 & 5 \\ \hline 8 & 6 \\ \hline 9 & 6 \\ \hline 11 & 6 \\ \hline 12 & 8 \\ \hline 13 & 7 \\ \hline 14 & 8 \\ \hline 15 & 8 \\ \hline \end{array}$$
It seems difficult to find an exact formula since $f(n)$ can, at times, go backwards as $n$ increases. An approximation is more reasonable.
In case you find an approximation, can you go into detail on how you found it?
Edit: Using graphs I found the approximation is
$$f(n)\approx \frac{\ln(n)^2}{2\ln(2)^2}-\frac{3\ln(n)}{2\ln(2)}+4$$
When $n>32$ but I don't know how to mathematically derive it.
Edit: I was wrong, see @Joriki’s answer. However, he didn’t fully answer my second question.
How would you apply your process to approximate $f(n)$ for more complex sets such as
$$A=\left\{\frac{1}{2^x}+\frac{1}{2^y}+\frac{1}{2^z}:x,y,z\in\mathbb{N} \right\}\cap[0,1]$$

