4
$\begingroup$

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 Answers 4

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

  • 10
    In other words, if $n \geq 10$ then $n^n \geq 10^n$ which has$n+1$digits....2012-04-06
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.

  • 0
    @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.2012-04-06
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$...

  • 0
    @alex.jordan No need to be sorry. It probably is good to write posts in a more elaborate manner. Thank you,2012-04-06