# Result of the $9^{9^9}$

So we were given a task for some bonus points to calculate and give the teacher the exact number of $9^{9^9}$. But the number is so big that I couldn't find where to calculate it to receive a precise number. I used python with a gmpy libraby to get a precise number but after almost 4 hours of running it crashed after it ran out of memory. So I am wondering is there actually a way to calculate the precise number?

• Exponentiation is not associative. Please use parenthesis. Sep 22, 2015 at 18:49
• it is easy to write in base 9 :) Sep 22, 2015 at 18:53
• do you want the result by email? it is about 1Gb long Sep 22, 2015 at 18:59
• @NikolayGromov: It's even easier to write down in base $9^{9^9}$. Sep 22, 2015 at 19:06
• What do you want, an explanation about how one might speed up the computation? Or people just throwing digits at you, surely that must be your goal... Sep 22, 2015 at 19:07

Since $9^9 = 387420489$, you have $$\log_{10} 9^{9^9} = 9^9 \log_{10} 9 = 369693099.6\ldots$$ so that the resulting number has 369,693,099 $+$ 1 digits.

• which is less then 1Gb, so assuming 8Gb memory it should be possible to compute it Sep 22, 2015 at 18:58
• @Nikolay: That depends on how you store the digits. But in generally I don't think it's about memory, it's probably about computation time. Sep 22, 2015 at 19:20
• the same objections as some other authors - does not answer the question. It give an impression that the answer is "no way". Sep 22, 2015 at 22:06
• @NikolayGromov feel free to downvote if you don't like the answer. Sep 22, 2015 at 22:20
• @UmbertoP., I generally delete my comments pointing out minor errors once they've been fixed, to remove clutter. I'll delete this one too once you've had a chance to read it (which you can indicate by deleting your reply). I had to think about whether the rounding goes up or down. Sep 22, 2015 at 22:31

First $~80$ digits:

$$428124773175747048036987115930563521339055482241443514174753723053523887471735048$$

The rest I can share with dropbox. My estimate - with mathematica it will take about $<7$ days to compute all digits, if you want to try run this:

res = 9^9^SetPrecision[9., M]


where $M$ is the number of digits. First $10000$ digits take about $4$ minutes.

Update:

In Mathematica it take $9$ seconds. The trick to make it faster is to write

res = 9^(9^9);


that's what Robert Israel did in Maple

Update2:

Tried the same order of operations in Python - does not work

import gmpy2
a = gmpy2.mpz('9')**gmpy2.mpz('9')
gmpy2.mpz('9')**a


crashed kernel in 10 seconds. May be some memory issues.

• Dropbox is no fun. Write it out using paper and ink and send it to the OP's teacher by mail. Sep 22, 2015 at 19:06
• I wonder how many pages it would take at 12-sized times new roman :~) Sep 22, 2015 at 19:24
• About $105000$ for 11-size in Calibri, no ideas about 12 Sep 22, 2015 at 19:27

Maple does

r := 9^(9^9):


in about 10 seconds on my computer. Outputting the result to a file in Maple's internal format (an m-file) takes about 170 seconds (the file is about 208 Mb). Saving to a text file (in decimal format) takes about 178 seconds: the file is about 379 Mb.

• Spectacular! Mathematica is much slow in this case which is strate as for such basic operations they both use the same C package for multiple precision algebra. Sep 22, 2015 at 19:43
• In Mathematica that's the same in fact - about $9$ sec. Sep 22, 2015 at 19:54

Well, whatever number you meant $x=(9^9)^9, 9^{9^9}$ you can give your teacher the answer:$x=1$. It is just written in the $x$-ary basis. It is impossible for any computer to calculate the second number $x$ in decimal expansion.

Edit: Clearly I was wrong regarding the computer power required to perform the calculation!

• are you hinting they are using Python at school? Sep 22, 2015 at 18:55
• Wow, I severely misjudged nowadays computational power. I am not so familiar with computer calculations. Sep 22, 2015 at 21:31

Let $y=9^{9^{9}}$

$\log_{10}(y) = 9^9\log_{10}(9) = 9^{9}\times \times 2 \times 0.4771 = 369676630.6038$

So $\log_{10}(y) = 369676630.6038\Rightarrow y=10^{369676630.6038}$

• So $9^9^9$ is even?
– quid
Sep 22, 2015 at 18:58
• No It is odd no. bcz we have take approx of $\log_{10}(3) = 0.4771$ Sep 22, 2015 at 18:59
• So your answer is not exact. You might want to make this clear.
– quid
Sep 22, 2015 at 19:00
• Indeed, the last digit is a 9. Sep 22, 2015 at 19:03
• This does not answer the question, just points out that the number is big. It is not too big, to be honest. It is doable. Sep 22, 2015 at 20:08