4

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?

Thanks in advance.

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

4 Answers4

17

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$.

Thomas Andrews
  • 177,126
4

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.

3

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.

  • 1
    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 06 '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 06 '12 at 17:33
2

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 06 '12 at 17:02
  • @ThomasAndrews Sorry about that blooper. –  Apr 06 '12 at 17:03
  • Can the downvoter explain? –  Apr 06 '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. –  Apr 06 '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. – 2'5 9'2 Apr 06 '12 at 17:39
  • You're right about $n$, I pretty much instantly pulled my earlier comment. – 2'5 9'2 Apr 06 '12 at 17:41
  • @alex.jordan Done. How does that look? –  Apr 06 '12 at 17:46
  • Looks great. Sorry if I was nitpicking. – 2'5 9'2 Apr 06 '12 at 18:03
  • @alex.jordan No need to be sorry. It probably is good to write posts in a more elaborate manner. Thank you, –  Apr 06 '12 at 18:05