Determine a the length of an operation's result in any base

67 Views Asked by At

In Project Euler problem 16, you have to sum up the digits of $2^{1000}$. A non-brute force solution had the prerequisite to know the length of the result beforehand and the following formula gave the result: $1000\log_{10}(2)+1$. Could someone explain where this came from? And add a generalization (and resources on the background of the topic).