If $a^b$ has $b$ digits, what is the greatest value of $b$? 
For natural numbers $a$ and $b$, what is the greatest value of $b$ so that $a^b$ has $b$ digits?

I knew that the greatest value of $b$ is $21$, where $9^{21}=\underset{21 \text{ digits}}{\underbrace{109,418,989,131,512,359,209}}$, but I am not sure how to prove that there is no greater value of $b$.
 A: A natural number $n$ has $b$ digits iff $10^{b-1}\le n<10^b$. So for this to hold for $a^b$, we clearly need $a<10$, or: $a\le 9$. On the other hand, we need $(\frac{10}{a})^{b-1}\le a$. For given $a$, this can be solved by taking logarithms. We obtain $b\le 21$ for $a=9$ and $b\le 10$ for $a\le8$. So, as perhaps expected, we use $a=9$ and find
$$9^{21}=\underbrace{109,418,989,131,512,359,209}_{21}$$
as largest case.
A: Proof sketch: First show that $a=9$ is the best possible value for $a$ (you don't have to show that it is better than any other value, just that no other value can possibly be better). Then find the maximal $b$ that works for $a=9$ through brute force.
Alternately: If $a^b$ has $b$ digits, what can be said about $\frac{a^b}{10^b}=\left(\frac{a}{10}\right)^b$? Now in a similar manner show that $a=9$ is optimal and then afterwards, find the best possible $b$. This way it's a bit easier to show that nothing untoward happens for larger $b$.
A: You are trying to find the maximum $b$ that satisfies $10^{b-1}<9^b<10^b$ (it is easy to show $a=9$ is best possible) and as you said $b=21$ satisfy that. Also if a "$b$" doesn't satisfy the inequality, then $b+1$ also doesn't. (easy to show that) And $b=22$ doesn't satisfy the inequality. Thus $b=21$ is the maximum number.
A: If $a^b$ has $b$ digits then 
$10^{b-1} \le a^b < 10^b$.
$\log 10^{b-1} \le \log a^b < \log 10^b$ (Notation: $\log$ means $\log_{10}$)
$b-1 \le b\log a < b$
$1 - \frac 1b \le \log a <1$.  so $a < 10$
The largest we can allow $b$ to be, the closer to $1$ that $\log a$ will be. 
Smaller values of $a$ will result is smaller options for $b$ and large options of $a$ will allow for larger options for $b$.  And if $a <a'$ and $b < b'$ we have $a^b < a'^{b'}$ we clearly will get larger values of $a^b$ if $a$ is as large as possible.  So we can make $b$ largest (and therefore $a^b$ largest) when $a = 9$.
so $1-\frac 1b \le \log 9< 1$
which means $b \le \frac 1{1-\log 9}$
Welp.... calculator time... $b \le 21.85$ so $9^{21}$ is indeed the largest such number.
