Abstract
Abstract
2^2^2^2^2^2, more specifically, 2^(2^(2^(2^(2^2)))) is a very large number. So large, it has been said, not even its first digit is known.
Indeed, a straightforward evaluation results in overflow, both in integer and in float, even in Mathematica.
However, it is possible to obtain as many first digits as memory allows by using properties of log’s mantissa.
Indeed, a straightforward evaluation results in overflow, both in integer and in float, even in Mathematica.
However, it is possible to obtain as many first digits as memory allows by using properties of log’s mantissa.
The “bigness” of 2^2^2^2^2^2 (six 2s)
The “bigness” of 2^2^2^2^2^2 (six 2s)
2^2^2^2^2^2 (with six 2s), more specifically 2^(2^(2^(2^(2^2)))) is very big. It results in overflow in both integer and float computations even in Mathematica.
2^2^2^2^2^2
Out[]=
Overflow[]
2^2^2^2^2^2.
Out[]=
Overflow[]
However, 2^(2^(2^(2^2))) (with five 2s) can be evaluated,
Short[2^2^2^2^2,1/3]
Out[]//Short=
20035299304019705905719156736
resulting in a 19,729-digit integer.
IntegerLength[2^2^2^2^2]
Out[]=
19729
The sheer size of this 19,729-digit number should be appreciated in perspective. For example, Avogadro’s number has 24 digits, and the number of atoms in the known universe has somewhere around 80 digits. A 100-digit number is a rare creature. For example, in order to have 100-digit count of atoms in the universe, the universe has to expand on minimum 1,000,000,000,000,000,000 times (in voluming, assuming the density is maintained) than the current known one.
Going back to the main topic at hand, the availability of 19,729-digit evaluation of 2^2^2^2^2 (five 2s) allows us to move one step further toward finding the starting digits of 2^2^2^2^2^2 (with six 2s) as shown below.
Going back to the main topic at hand, the availability of 19,729-digit evaluation of 2^2^2^2^2 (five 2s) allows us to move one step further toward finding the starting digits of 2^2^2^2^2^2 (with six 2s) as shown below.
Start with of n=2^2^2^2^2 (five 2s) then find n2 (six 2s)
Start with of (five 2s) then find (six 2s)
n=2^2^2^2^2
n
2
This problem can be approached by finding 2^2^2^2^2 (five 2s) first, as shown above, then evaluating 2 raised to that number. That is,
In[]:=
n=2^2^2^2^2;
Then finding in such a way that it will reveal the first digits.
n
2
Mantissa
Mantissa
"An important property of base-10 logarithms, which makes them so useful in calculations, is that the logarithm of numbers greater than 1 that differ by a factor of a power of 10 all have the same fractional part. The fractional part is known as the mantissa." Source: Common Logarithm, Wikipedia
In other words, the logarithms with base 10 of numbers that start with 12345, regardless of where the decimal point is placed,
In other words, the logarithms with base 10 of numbers that start with 12345, regardless of where the decimal point is placed,
Log[10.,#]&/@{0.12345,1.2345,12.345,123.45,1234.5,12345,123450,1234500}
Out[]=
{-0.908509,0.0914911,1.09149,2.09149,3.09149,4.09149,5.09149,6.09149}
will all have the same mantissa of ≈0.0914911. Although Mantissa is defined as “fractional part,” Mod[number, 1] operation should be used to guard against positive numbers less than 1 which will produce negative exponents.
Mod[#,1]&/@%
Out[]=
{0.0914911,0.0914911,0.0914911,0.0914911,0.0914911,0.0914911,0.0914911,0.0914911}
It means we only need to know the mantissa of the exponent when 2^2^2^2^2^2 (six 2s) is expressed as
=
in order to know the first digits of which is 2^2^2^2^2^2 (six 2s).
By taking() on both sides we can solve for .
This re-writing above of log expression using identity is the most crucial step because it allows us to sidestep, which is too big to be computed (if it wasn't, we wouldn't be doing all this mental gymnastics after all). On the other hand, computing is within reach because we already obtained n above, and multiplying it by (2), which is around 0.301, won't cause overflow. Now, we just need to find (2) in high enough precision.
p
n
2
p
10
in order to know the first digits of
n
2
By taking
log
10
p
p()n(2)
log
10
n
2
log
10
This re-writing above of log expression using identity is the most crucial step because it allows us to sidestep
n
2
n(2)
log
10
log
10
log
10
High enough precision for log10(2)
High enough precision for (2)
log
10
Empirically check the accuracy of the mantissa vs the accuracy of the first digits. That is, how many digits of mantissa is needed to reproduce the starting digit sequence of 23456789. It appears having about 4-digit accuracy in mantissa is need to ensure the reproduction of the first four digit in the original number. We will assume this 1:1 correspondence between these accuracies.
In[]:=
N[Log[10,23456789],10]
Out[]=
7.370268561
In[]:=
0.3
10
Out[]=
1.99526
In[]:=
0.37
10
Out[]=
2.34423
In[]:=
0.3702
10
Out[]=
2.34531
In[]:=
0.37026
10
Out[]=
2.34563
In[]:=
0.370268
10
Out[]=
2.34568
How high a precision do we need? We use the number of digits of as our guide.
n
digitLength=IntegerLength[n]
Out[]=
19729
In other words, in order to reproduce the integer part of accurately, we need 19,729-digit precision. However, the mantissa that we are after starts after the decimal point. Our precision has to be at least 4 more than that.
However, since we are not sure about the 1:1 accuracy correspondence assumed above, instead of playing near the fire, we just double the required accuracy to 19,729 39,458 as a safety factor. This ensures that the mantissa has 19,729-digit accuracy after 19,729-digit accuracy integer part is taken out.
n
However, since we are not sure about the 1:1 accuracy correspondence assumed above, instead of playing near the fire, we just double the required accuracy to 19,729
×2=
log2Base10=N[Log[10,2],2digitLength];
Due to its length, only the first 50 digits are shown.
N[log2Base10,50]
Out[]=
0.30102999566398119521373889472449302676818988146211
(I have been carrying this 0.301 in my memory since my high school days. Not once have I suspected that I would try to obtain this number to its 39,458th digit some day. But here we are.)
Find the mantissa which corresponds to the fractional part of.
Find the mantissa which corresponds to the fractional part of
n(2)
log
10
In[]:=
mantissa=FractionalPart[(nlog2Base10)];
Only the first 50 digits are shown for brevity.
N[mantissa,50]
Out[]=
0.32634379468066900395431106748523745510481197775106
Find the first thousands of digits of 2^2^2^2^2^2 (six 2s)
Find the first thousands of digits of 2^2^2^2^2^2 (six 2s)
Then find the starting digits of . Only the first 50 digits are shown for brevity.
n(2)
log
10
10
N[10^mantissa,50]
Out[]=
2.1200387288082119848851646916622746308356542306754
The number above should not be confused with the actual 2^2^2^2^2^2 (six 2s).
2^2^2^2^2^2 (six 2s) is an integer that starts with the digits above and continues on to many digits. As for exactly how many digits, it will be computed below.
Our mission to find the first digits of 2^2^2^2^2^2 (six 2s) is accomplished.
2^2^2^2^2^2 (six 2s) is an integer that starts with the digits above and continues on to many digits. As for exactly how many digits, it will be computed below.
Our mission to find the first digits of 2^2^2^2^2^2 (six 2s) is accomplished.
Find the number of digits in 2^2^2^2^2^2 (six 2s)
Find the number of digits in 2^2^2^2^2^2 (six 2s)
We also can find out how many digits 2^2^2^2^2^2 (six 2s) has by using the non-mantissa, i.e., the integer part of n. The number of digits in 2^2^2^2^2^2 (six 2s) would be one more than the number below which was not shown due to its length.
log
2
In[]:=
intergerExponent=IntegerPart[(nlog2Base10)];
Its few digits can be glimpsed by using Short function.
Short[intergerExponent,1/3]
Out[]//Short=
60312260626302953719692149530140391357847
The number of digits of the number of digits of 2^2^2^2^2^2 (six 2s) is.
IntegerLength[intergerExponent]+1
Out[]=
19729
The order of magnitude of the number of digits in m2 vs the number m in general
The order of magnitude of the number of digits in vs the number in general
m
2
m
The number of digits of the number of digits of is 19,729 which is also the number of digits of . Is this a coincidence?
This implies that the number of digits of has the same order of magnitude as . This question would be more intuitive if the base was 10. But even with base 2, this is possible to establish a pattern.
In general, the number of digits in (in base 10) can be expressed as ()+1=m(2)+1≈0.301m+1
Since would have the same (or one smaller) order of magnitude as , it follows that the number of digits of has the same (or one smaller order of magnitude as .
n
2
n
This implies that the number of digits of
n
2
n
In general, the number of digits in
m
2
log
10
m
2
log
10
Since
0.301m+1
m
m
2
m
An attempt to grasp the size of 2^2^2^2^2^2 (six 2s)
An attempt to grasp the size of 2^2^2^2^2^2 (six 2s)
These numbers (five 2s) and (six 2s) are so large, we have to express them with the order of magnitude of the order of magnitude, which we abbreviate as ofmotofm here.Using this newly defined function, we obtainTo put in perspective(Avogadro’s number) (number of all atoms in the universe) While an increase of 1 in the order of magnitude means the number was multiplied by roughly 10 (or became ), an increase of 1 in value means the exponent m in roughly ten folded to (or became ).Consider one of the most dramatic change in size in we can imagine. Going from the size of a proton is to the distance to Andromeda is . Their ratio is about , i.e., their orders of magnitude increase is 36. But in , because and , it increased by 2. It is doubtful there are any two objects in this universe we can compare that would produce ofmotofm value difference that goes much beyond 2 or 3.In that light, the jump of 19,274 ( ) between and in their respective ofmotofm values demonstrates just how far beyond our comprehension these numbers are.
n=2^2^2^2^2
n
2
ofmotofm(n)=5ofmotofm()=19279
n
2
ofmotofm
=2
ofmotofm
=2
x
10x
ofmotofm
m
10
10m
10
x
10
x
-12
10
24
10
36
10
ofmotofm
ofmotofm()=0
0
10
ofmotofm()=2
36
10
19279-5
n
n
2
Acknowledgements
Acknowledgements
I would like to thank Dr. Stephen Wolfram who inadvertently made me aware of this challenge through this video https://www.youtube.com/watch?v=Ak0x5iz3mfg&t=661s .
I would like to thank Mr. Ed Pegg who not only confirmed the accuracy of the solution, but also encouraged me to write it up in this community. I could not have discovered this his guidance.
And I also thank Prof. Manoel Montagnoli who taught me mathematics.
I would like to thank Mr. Ed Pegg who not only confirmed the accuracy of the solution, but also encouraged me to write it up in this community. I could not have discovered this his guidance.
And I also thank Prof. Manoel Montagnoli who taught me mathematics.
