Energy Tower Solutions

a=2^Power[10^6, 10^9] 3^Power[4^9, 7^5]
TwoTower[n_] := Nest[2^# &, 1, n]

What is the smallest nsuch that TwoTower[n]>a? This question had a written answer to Quora, is there a way to use Mathematica here?

+3
source share
1 answer

Just some thoughts (not thoroughly checked). If we follow the suggestion in this link and start taking magazines (base 2), the first thing that seems obvious is that we can safely forget the pre-factor (power 3), because

Log[Log[a*b]] = Log[Log[a]+Log[b]] = Log[Log[a]]+Log[1+Log[b]/Log[a]] = 
= Log[Log[a]] + Log[b]/Log[a] + O((Log[b]/Log[a])^2), Log[b]<<Log[a]

where ais degree 2, and bis degree 3. Then we can focus only on degree 2. If we define our version logand power:

Clear[log2,power];
log2[2] = 1;
log2[1] = 0;
log2[a_*b_] := log2[a] + log2[b];
log2[a_^b_] := b*log2[a];
log2[power[a_, b_]] := b*log2[a]; 

Then the answer seems like this:

In[62]:= 
    Length[NestWhileList[N[Log[2, #]] &,log2[log2[log2[ 2^power[10^6, 10^9]]]] /. 
           log2 -> (N[Log[2, #]]&), # > 1 &]] - 1 + 3

Out[62]= 7

1 - , NestWhile ( ), 3, log2 3 , NestWhileList. , .

Edit:

, , :

ClearAll[log2, power];
log2[2] = 1;
log2[1] = 0;
log2[a_*b_] := log2[a] + log2[b];
log2[(power | Power)[a_, b_]] := b*log2[a];
log2[x : (_Integer | _Real)] := N[Log[2, x]];
power[a_, b_] :=
   With[{eval = Quiet[Check[Power[a, b], $Failed]]},
     eval /; (eval =!= $Failed)]

:

In[8]:=Length[NestWhileList[log2,2^power[10^6, 10^9], ! FreeQ[#, power] || # > 1 &]] - 1

Out[8] = 7
+3

Source: https://habr.com/ru/post/1785558/


All Articles