[Math] What’s the first power of two for which the most significant digit is 7

elementary-number-theory

I was just reading an anecdote about a third-grade student who was asked by her math teacher to find a number which, when two is raised to the power of that number, produces a number that starts with the digit 7 (in base 10, as the context makes clear).

I was able to quickly write a one-liner in Perl that found the smallest such number, 46, which is also the number ultimately found by the student. But the story states that the question was given in a math class, and implies that the student found the answer without the aid of a computer.

I haven't been able to come up with an avenue of attack for this problem that doesn't depend on a computer, much less one that a third-grader, even at a relatively advanced level of mathematics, might discover. So how can this be done?

In the more general case, it would be nice to see a solution to the problem of "Given an integer $b$ and digit $d$, what's (a/the smallest) power $n$ such that $b^n$ has leading digit $d$ in base 10?"

Best Answer

It is not all that hard, if we remember the frequently useful $2^{10}=1024$, which is $2.4$ percent more than $1000$.

The small power of $2$ that is closest to beginning with $7$ is $2^6$, which is $64$. We need to increase $64$ by a bit under $10$ percent, times a power of $10$. But since we are concerned only about the first digit, we don't really even see the powers of $10$, intuitively we just want to push from $6.4$ to $7$.

It is easy to see that pushing up twice by $2.4$ percent is not enough to push us up to beginning with $7$. That doing it three times is not enough is less obvious, but a bit of fooling around, even without a calculator, does the job: although the compounding helps, $2.4$ percent three times does not give $10$ percent. It is clear that increasing $64$ by $2.4$ percent four times will get us to the $7$, and leaves us quite far from beginning with $8$. So the required power is $6+(10)(4)$.

The starting digit that takes longest to reach is $9$. This is trickier to do by hand, for $2^{53}$ barely gets us there. It is the first legitimate candidate, but calculations have to be more accurate than for the digit $7$, to make sure that we don't need to go up to $63$.