$f(n)$ calculates how many times $2$ appears in numbers from $1$ to $n$. For example, $f(1)=0$, $f(2)=1$ and $f(12)=2$.
What is the first $n$ for which $f(n)=n$?
I would need first of all to figure out the function itself, if you can help me. And also the result, so I can compare after I solve the function myself.
Please help me with this one, I am stuck. I tried to do it through MS Excel, but the number is too large for what Excel can handle. Any help is highly appreciated.
Thanks!
p.s: thanks to Sidd, I now have an answer. However, if someone can also figure out the mathematical function for this, it would be very helpful.