# Is $e^{e^9}$ an integer?

I mean, of course $e^{e^9}$ is not an integer, but can we prove this? If you're thinking of asking Wolfram|Alpha, be warned: it gives different answers to the questions "is exp(exp(9)) an integer" (WA says "No") and "is exp(exp(9.0)) an integer" (WA says "Yes").

• Yes, you can. ${}$ – Pedro Tamaroff Apr 22 '15 at 1:20
• If you can prove: for some $n$: $n < e^{e^{9}} < n+1$, then it is not an integer. – DeepSea Apr 22 '15 at 1:23
• @AlonAmit: It has probability $1$ of being right. – André Nicolas Apr 22 '15 at 1:34
• Perhaps we should try to prove the more general: $e^{e^n}\not\in\mathbb N$ for $n\in\mathbb N$. – Akiva Weinberger Apr 22 '15 at 2:00
• @CarlMummert I don't think that's a duplicate; $e^{e^9}$ is within the realm of computation whereas $e^{e^{e^{79}}}$ is decidedly in the realm of theory - and that's expressed as a pretty big difference in terms of the answers these questions have received. – Milo Brandt Apr 22 '15 at 2:06

We could prove it is not an integer by providing explicit bounds. If you really wanted to, you could note the following common inequality, holding for all positive $n$: $$\left(1+\frac{1}n\right)^n<e<\left(1+\frac{1}n\right)^{n+1}.$$ Which yields a series of rational bounds for $e$, where both sides converge to $e$ as $n$ heads to infinity. The point here is that, if we know that $x$ is in the interval $\left[\frac{a}n,\frac{b}{n+1}\right]$, then it follows that $$\left(1+\frac{1}n\right)^{a}<e^x<\left(1+\frac{1}n\right)^{b}.$$ Taking such an approximation for large enough integer $n$ yields arbitrarily tight rational bounds on $e^x$. From those bounds, you can prove bounds on $e^{e^x}$. I would imagine that you need to find fairly tight bounds, but it's nothing a computer couldn't do.

Now figuring out if it's rational... that's a different story.

Okay, having actually tried to make my computer do the above, it turns out that $e^x$ grows really fast near $x=e^9$ and that the above bounds work in theory, but only slowly. It doesn't quite cut it unless your computer is bigger than mine. We could swap out whatever bounds we want though - for instance, a crude bound arising from the series for $e^x$ is (assuming $x$ is positive and $n\geq 2x$). $$\left(\sum_{i=0}^n\frac{x^i}{n!}\right)<e^x<\left(\sum_{i=0}^n\frac{x^i}{n!}\right)+\frac{x^n}{n!}$$ converges much faster, and would probably yield the desired bound with some effort. You could also try rounding rationals down (in the lower bound) and up (in the upper bound) to shave some time off doing exact rational arithmetic.

Fleshing out my comment into an answer: we know that $e^9\approx 8100$, so that the integer part of $e^{e^9}$ is roughly 12,000 bits. This means that we can get a value to sufficient accuracy by:

1. Computing $e$ to 'sufficient' accuracy (being conservative, $2^{16}$ bits should be enough here; it's not hard to do a more accurate error analysis, but the number is small enough that we can afford to be sloppy).
2. Computing $e^9$ to similar accuracy (likely by just squaring $e$ three times and multiplying by $e$, if I were going to do this with a quick manual application) and then computing $\frac{e^9}{8192}$ (a different number could be used here to make the next steps converge faster, but that's just tuning).
3. Computing $e^{e^9/8192}$; since $\frac{e^9}{8192}\lt 1$, this can be done fairly efficiently.
4. Finally, computing $e^{e^9}=(e^{e^9/8192})^{8192}$ by repeated squaring.

As mentioned, none of these operations should need to work on numbers much longer than about $2^{16}$ bits, which means that all of these values will fit comfortably in memory and nothing will take more than a few million bit-operations to compute. You could probably do this to sufficient accuracy on a modern processor in well under a minute. And critically, explicit error bounds are available for the algorithms for all of these operations, so that you can assure yourself that errors won't magnify enough to swamp the result.