# Find $n$ where $n^n$ has $n$ digits

Find n $\in \mathbb{N}$ if $n^n$ has $n$ digits. A problem I ran into today and it seemed interesting.

I know $1$, $8$ and $9$ are (the obvious) solutions, but are these the only ones? If they are, how can you prove it?

EDIT: Yes, I was looking at natural numbers, my bad, I think it was some kind of typo.

The number of digits of $m$ is $1+\lfloor\log_{10} m\rfloor$.

So the number of digits of $n^n$ is $1+\lfloor n\log_{10} n\rfloor$.

If $log_{10} n \geq 1$, then $n log_{10} n\geq n$, so the number of digits of $n^n$ is always at least one more than $n$. So there are no such values $n>9$.

• In other words, if $n \geq 10$ then $n^n \geq 10^n$ which has $n+1$ digits.... – N. S. Apr 6 '12 at 18:04

The main idea here is to show there are very few possibilities. It's clear (in a variety of ways) that the number of digits in $n^n$ grows faster than $n$. Therefore, to solve your problem, all you have to do is to keep checking $1, 2, 3, \cdots$ until you get to the point where it's clear $n$ can no longer catch up to the number of digits in $n^n$.

At $n=10$, $10^{10}$ has 11 digits. Past this point, every time you increase $n$ by 1, you add at least one more digit to $n^n$, so this is as far as you need to check.

Really, the main difficulty here is not to overthink the problem; it's easy to overlook the easy solutions if you're too busy looking for hard ones.

Well, you're actually looking at elements of the natural numbers, not of the reals, unless you have a meaningful definition of having a non-integer number of digits. (Question was edited to address this.) While it's not a formal proof by any stretch, you can quickly look at the natural numbers in the range 10-20 and see that the number of digits increases faster than n does, so the solutions 1, 8, and 9 are the only ones.

• It becomes a more formal proof if you say $10^{10}=10,000,000,000$ has $11$ decimal digits and that $(n+1)^{n+1} \gt n^{n+1} = n \times n^n$ has at least one more decimal digit than $n^n$ when $n\ge 10$. – Henry Apr 6 '12 at 17:05
• @nbouscal : What you did is just building intuition to give you a direction, i.e. giving you an idea of what you should try to prove. – Patrick Da Silva Apr 6 '12 at 17:33

Hint:

$$\text{Number of digits in k}=\lfloor \log k \rfloor+1$$

Now, use $k=n^n$ in the above formula and recall that you explicitly want $LHS$ to be $n$, you should get:

$$\lfloor n \log n\rfloor+1=n$$

Note that you may want to use $\log a^b=b \log a$...

• The number of digits of $m$ is not the ceiling of the log, if $n$ is a perfect power of $10$ (I assume you mean $log_{10}$. – Thomas Andrews Apr 6 '12 at 17:02
• @ThomasAndrews Sorry about that blooper. – user21436 Apr 6 '12 at 17:03
• Can the downvoter explain? – user21436 Apr 6 '12 at 17:34
• @alex.jordan The question wants the number of digits of $n^n$ to explicitly be $n$. So, it boils to solving what I have written. – user21436 Apr 6 '12 at 17:37
• I'm not the down voter. But maybe it should be cleared up that you are not making a general claim, but rather that this is a specific claim about the OP's $n$. Maybe that's obvious though. The other thing is that while this hint very quickly provides an answer, it's not clear to someone unfamiliar with the digits formula why this should be true. – alex.jordan Apr 6 '12 at 17:39