How many of the numbers $2^m$ (where $0\le m\le M)$ have leading digit $1$?
My trial -
Since leading digit $=1$, whenever $2^m$ reaches or just crosses a $10^x$ and is less than $2 \cdot 10 ^ x$, that $m$ is eligible i.e.
$10^x \le 2^m \lt 2\cdot 10^x.$
But $x$ also depends on the current $m$, so $x$ must also satisfy
$(m-1)\cdot \log 2 \le x \lt m \cdot \log 2$ (which directly follows from the previous inequality).
So the final summation is:
$\sum\limits_{(x, m)}\left([10^x \le 2^m \lt 2\cdot 10^x]\cdot[(m-1)\log 2 \le x \lt m \log 2]\cdot[0 \le m \le M]\right).$
I think I am making it a bit too complex, my main confusion is regarding the manipulation of $x$, can anyone help? (The brackets are Iverson notation which is $1$ if true and $0$ if false).