Associated Topics || Dr. Math Home || Search Dr. Math

### 9^9^9

```
Date: 09/10/97 at 18:53:43
From: Sean H
Subject: 9 ^ 9 ^ 9

Dr. Math,

In my Algebra II class, my teacher asked us what the largest number we
can write is, only with a limit of 3 digits. I answered 9 ^ 9 ^ 9
(nine to the ninth to the ninth) and was correct.

Getting home, and on my computer however, I set out to find the answer
to that question. 9 ^ 9 was easy:  387420489. But now, how in the
world to do 9 ^  387420489?

I tried writing a C++ program to do it, only the largest data type you
can use, an unsigned long, only supports up to 10 digits. That wasn't
getting me anywhere. On the Internet, I saw one person say that the
answer would have 300,000,000 digits! Is this true?

So my question: Is it really that large an answer? And is there a way
I could find the answer? If it really is that big, how long would it
take to answer on a large mainframe? (I'm talking Cray here). Would it
be hours, days, months, or years?

Thanks a lot,
Sean
```

```
Date: 09/25/97 at 15:47:28
From: Doctor Ken
Subject: Re: 9 ^ 9 ^ 9

Hi!

To find out how many digits some number has, the best way is to take
the log base 10 of that number and round down to the nearest integer,

For instance, 42 has 2 digits, and the log base 10 of 42 is about
1.62325: round that down and you get 1, add 1 and you get 2. 34578 has
5 digits, and its log base 10 is 4.5388: round it down and you get 4,
add 1 to get 5. 1000 has 4 digits and its log base 10 is 3. Round down
to get 3, add 1 to get 4.

So we want to find the log base 10 of your number, 9^387420489. Let's
do it:

Log (9^387420489) = 387420489 * Log(9)       (Pull out the power)
= 387420489 * 0.954243     (do the log)
= 3.6969309963 x 10^8      (by calculator)
= 369693099.63

So your number has 369,693,100 digits. That's a big number!

By the way, we have a section of our site devoted to large numbers.

-Doctor Ken,  The Math Forum
Check out our web site!  http://mathforum.org/dr.math/
```
Associated Topics:
Elementary Large Numbers

Search the Dr. Math Library:

 Find items containing (put spaces between keywords):   Click only once for faster results: [ Choose "whole words" when searching for a word like age.] all keywords, in any order at least one, that exact phrase parts of words whole words

Submit your own question to Dr. Math
Math Forum Home || Math Library || Quick Reference || Math Forum Search