The way to calculate the first digits of $a^b$ is to compute the $log_{10} a$ and multiply by $b$, and find the fractional part. But if there are too many digits in the integer part of the result, then the digits after the point are inaccessible. By too many digits I mean enough digits to overflow a computer's memory. So this question boils down to, how many digits can be represented in a computer's memory?

The largest number I have ever computed the first digits of is $2^{2^{2^{32}}}$ which begins with 315921269337233843004... and has more than $9.34*10^{1292913985}$ digits. It took literally almost all my computer's RAM and 30 hours of my time to calculate.

Is there any hope of eventually finding the first digits of, say, $3^{3^{3^{3^3}}}$ at some point?


marked as duplicate by MJD, ArsenBerk, Jim, José Carlos Santos, Shailesh Feb 22 '18 at 0:09

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 2
    $\begingroup$ cs.stackexchange.com $\endgroup$ – wilkersmon Feb 21 '18 at 18:11
  • $\begingroup$ I know the first and last digits of $10^{10^{10^{17}}}$... $\endgroup$ – MJD Feb 21 '18 at 18:37
  • $\begingroup$ The “duplicate” of this question explicitly has a different answer than this one. I believe they are substantially different even though the OP did not intend them to be different. $\endgroup$ – Erick Wong Feb 22 '18 at 3:42

Actually the bolded question in your OP is not equivalent to the question in your title!

If you used up all your RAM, then I suspect you did not use a spigot algorithm for extracting the 4 billionth binary digit of $\ln 2$?

Spigot algorithms use only a small amount of RAM, because the calculations (though still time-intensive) should only require a logarithmic level of precision, maybe kilobytes rather than gigabytes. So it is not necessary to represent the entire number $2^{2^{32}} \ln 2$ just to get access to the first few digits of its fractional part.

Naively it seems to me that the $\ln 2$ spigot algorithm is at least as efficient as spigot algorithms for $\pi$ and equally parallelizable, and those already reached the 10 quadrillionth bit fairly recently, with only a modest amount of modern computational power (a few dozen desktop computers for a few months).

So with more dedicated resources (imagine this was the next Bitcoin craze) one could probably compute the sextillionth binary digit of $\ln 2$, which would allow one to extract initial digits for $2^{2^{2^{70}}}$ or so.

I’m aware that there are spigot algorithms for other logarithms in other bases but I’m unfamiliar with the particulars. Assuming that ternary digits of $\ln 3$ are roughly as efficient as binary digits of $\ln 2$, then $3^{3^{3^{3^3}}}$ is definitely attainable.


I actually asked how many ASCII characters can a computer write on Stack Overflow. This relates to your question because numbers are a part of ASCII. The largest storage device in the world can store 120 petabytes and each ASCII character is a byte it can store 1.2e+17 digits worth of numbers


Not the answer you're looking for? Browse other questions tagged or ask your own question.