Hyper4 Iterated Exponential Function
Contents
Exponentiation a^{b} = a↑b = a^{②}b
The "Lower" Hyper4 Function a_{④}b
An Exact Solution of the Inverses of a_{④}b
The Higher Hyper4 Function ("tetration") a↑↑b = a^{④}b
My Extension to RealValued Arguments
Finding Final Digits Using Modular Arithmetic
The main topic of this page is a function, hyper4, that takes two arguments and performs a repeated exponentiation operation. hyper4 is to ordinary exponentiation as exponentiation is to multiplication. Becase it is a function of two arguments, I also sometimes call it an operator.
For completeness I will begin by describing each of the more familiar operators, starting with the most basic.
Addition a+b = a^{①}b
Addition can be thought of as an iterated act of adding one:
a+b = a+1+1+1+1...
where there are b copies of 1 on the righthand side of the = sign.
Here is a table of the addition function for arguments from 0 to 6. It is the first part of a larger table that most grammarschool students learn:

By antidiagonals, this table is sequence A3056.
The rows and columns are all A0027 (omitting one or more initial terms).
The main diagonal is A5843.
The superdiagonal and subdiagonal are both A5408.
Multiplication a×b = a^{②}b
Multiplication is iterated addition. These two definitions are equivalent:
a×b = ((a+a)+a)+...+a
or:
a×b = a+...+(a+(a+a))
where in each case there are b copies of a on the righthand side of the = sign.
Here is a table of the multiplication function for arguments from 0 to 6. It is the first part of a larger table that most grammarschool students learn:

By antidiagonals, this table is sequence A4247.
The rows are A0004, A0027, A5843, A8585, A8586, A8587, A8588, etc.
Each column is the same as the corresponding row.
The main diagonal is A0290.
The superdiagonal and subdiagonal are both A2378.
Exponentiation a^{b} = a↑b = a^{②}b
Exponentiation is iterated multiplication. It is normally written a^{b} but on this page I will use the ↑ symbol, like this: a↑b. These two definitions are equivalent:
a↑b = ((a×a)×a)×...×a
or:
a↑b = a×...×(a×(a×a))
where in each case there are b copies of a on the righthand side of the = sign.
Here is a table^{1} of the exponentiation function for arguments from 0 to 6:

By antidiagonals, this table is sequence A3992.
The rows are A0007, A0012, A0079, A0244, A0302, A0351, A0400, etc.
The columns are A0012, A0027, A0290, A0578, A0583, A0584, A1014, etc.
The main diagonal is A0312.
The superdiagonal is A7778 and the subdiagonal is A0169.
Lower Hyper4 Function a_{④}b
There are two ways to extend the series to a fourth operator beyond exponentiation, depending on how you group the terms^{2}. Because of this I need to use different symbols to avoid confusion, and for one of the definitions there are two alternative symbols. To explain my "number in a circle" symbols, I should point out that in discussing these operators in general, it is useful to have an unlimited set of operator symbols. For this reason I sometimes use these alternate symbols for the three operators that have already been discussed:
a+b = a^{①}b
a×b = a^{②}b
a↑b = a^{③}b
The defintions of the two types of hyper4 are:
a_{④}b = ((a↑a)↑a)↑...↑a
and:
a↑↑b = a^{④}b = a↑...↑(a↑(a↑a))
where in each case there are b copies of a on the righthand side.
Both versions produce the same answer for a↑↑1 and a↑↑2 (a and a↑a respectively) but they differ beyond that. The first one produces smaller values so I call it the "lower hyper4 operator"; the other is the "higher" hyper4 operator. When necessary to distinguish between the two I use a_{④}b and a^{④}b respectively. For the latter function, the notation a↑↑b is more common in other literature.
Here is a table of the "lower" hyper4 function for arguments from 0 to 6:

By antidiagonals, this table is sequence A171881 (more terms here).
The first row is not in OEIS; second is A0012. Ignoring the 0 column, the next four rows are A1146, A55777, A137840, and A137841. The following rows are not in OEIS.
The first column is not an integer sequence. The next three columns are A0027, A0312, and A2489; the following columns are not in OEIS.
The main diagonal (without the initial term) is A89210.
The superdiagonal is A2488, and the subdiagonal is not in OEIS.
a_{④}b can be generalized easily to real and even complex arguments through the identity a_{④}b=a↑(a↑(b1)). So for example, π_{④}e is 3581.875516... and e_{④}π is 4979.003621...
An Exact Solution of the Inverses of a_{④}b
One might wonder how to compute the a_{④}b function "backwards", computing the equivalent of a hyper_{4} "logarithm" or "root". More precisely, given the equation:
z = x_{④}y = x^{x(y1)}
derive a solution for y in terms of x and z (the "hyper_{4}logatithm") and a solution for x in terms of y and z (the "hyper_{4}root").
The first one (getting y in terms of x and z) is pretty straightforward. Starting with z = x^{(x(y1))}, we merely need to take a (normal) logarithm to base x twice, then add 1:
z = x^{x(y1)}
log_{x}(z) = x^{(y1)}
log_{x}(log_{x}(z)) = y1
y = 1 + log_{x}(log_{x}(z))
That was pretty easy. How about the hyper_{4}root?
Solving for x is a little trickier, because we have an x to the power of x (a "selfexponential" or "coupled exponential" function) which has no closedform root in the standard elementary functions. However there is always a root to y=x^{x}, even if x is negative or complex (in which case the root is usually complex). You just have to use the Lambert W function, which is defined to be the inverse of a=b e^{b}:
a=b e^{b} if and only if b = W(a) (see footnote^{4})
To solve z = x_{④}y for x in terms of y and z, begin by defining k=y1 (which will be easy to undo later). This gives us
z = x^{xk}
Next, define l to be ln(x) (the latural logarithm of x), or equivalently x=e^{l}. Substituting this in for the x's, we get
z = (e^{l})^{(el)k} = e^{(l ek l)}
We can take the latural log of both sides:
ln(z) = l e^{k l}
than multiply by k, giving us
k ln(z) = k l e^{k l}
This is now recognizably similar to the definition of the Lambert W function above, with a=k ln(z) and b=k l. So we can go ahead and use the W function to express the relation as:
k l = W(k ln(z))
Now replacing k and l with their definitions in terms of y and x respectively, we have
(y1)ln(x) = W((y1)ln(z))
which readily leads to
x = e^{(W((y1)ln(z)) / (y1))}
Since the Lambert W function is defined for (almost) any complex argument, as are the logarithm ln(a) and exponential e^{a}, the lower hyper_{4} function can be used just as freely as each of those other functions.
The Higher Hyper4 Function ("tetration") a↑↑b = a^{④}b
As described above, the higher hyper4 operator defines a↑↑b as:
a↑↑b = a^{④}b = a↑...↑(a↑(a↑a))
where there are b copies of a on the righthand side.
Here is a table of values:

In the right column are three values beginning with "3 PT". This is an abbreviation for "three powers of ten". For example, "3 PT 8.0723×10^{153}" is 10^{10108.0723×10153}.
Reading across each row, it is easy to see that, once b gets large enough, each time you increase b by one, the value of a↑↑b increases to 10^{a↑↑b}. But of course, it should be a^{a↑↑b}, not 10^{a↑↑b}. In fact the values are different, but they are so close that the first few digits of the number at the top of the "power tower" are the same. This is due to the power tower paradox described below.
By antidiagonals, this table is sequence A171882 (more terms here).
First four rows are A0035, A0012, A14221, and A14222; following rows are not in OEIS.
First four columns are A0012, A0027, A0312, and A2488; following columns are not in OEIS.
The higher hyper4 operator cannot be extended in any obvious and selfconsistent way to the reals (to compute, for example, π^{④}e). This issue is discussed at length below, with possible solutions.
My Extension of the hyper4 Function to RealValued Arguments
The hyperexponential (also called "tetration" or "power tower") x^{④}y is defined for integer y>0 by:
x^{④}1 = x
x^{④}y = x↑(x^{④}(y1)) for y>1
The symbol ^{④} is explained above; see also this description) of the hyperN family of operators.
Several times, people have asked me: how can one define x^{④}y for real y? For example, what is π^{④}e)?
There are three other functions that have been extended to the reals in ways that seem promising: the factorials by the Gamma function, hyperfactorials by the Kfunction, and the lower (Simon and Plouffe 1995) superfactorial by Barnes' Gfunction. All of these are defined in terms of an integral or an infinite product and they all have a "recurrence relation" like Gamma(x+1) = x Gamma(x).
Defining x^{④}y in terms of an infinite product, or even an infinite product of infinite products of integrals, seems like it will not work since it needs to behave more like an infinite exponential "tower". Using this method for the hyper4 function would probably require using an integral that acts like the x^{y} function in one asymptote and like a lower function in the other.
Daniel Geisler has collected a lot of information related to this issue at his website, tetration.org. The best solution I have found so far was developed by I. N. Galidakis^{3}. It uses the concept of a power tower with gradually growing exponents — for example, it definines x^{④}0.8=x^{0.8}, x^{④}0.9=x^{0.9}, x^{④}1.0=x^{1.0}=x^{x0.0}, x^{④}1.1=x^{x0.1}, x^{④}1.2=x^{x0.2}, etc. While this function is continuous, its 1^{st}, 2^{nd}, etc. derivatives are not, except for the 1^{st} derivative when x=e.
Here is my attempt at the problem:
Begin by imagining an infinite power tower of the form:
x^{④}y = x↑(x↑(a↑(b↑(c↑...↑(1↑(1↑(1)))...))))
where there are a finite number of x's on the bottom, and an infinite number of 1's on the top. The 1's can be completely ignored, and all you need to look at are the x's and the special terms a, b, c, ... in the middle. These terms have values between 1 and x and are called "transition terms". (Galidakis' method fits this model but only has one transition term.)
Now imagine that the x's at the bottom are actually just a tiny bit smaller than x, and that the 1's at the top are actually a tiny bit larger than 1. In fact, every term of the power tower is between 1 and x. The terms shown as x are just very very close to x.
We want something that is wellbehaved, continuous and smooth. That means, essentially, x>a>b>c>1 and as y increases, the values of a, b, c increase gradually until eventually a=x. To achieve this result I decided to use the error function erf(z) = (^{2}/_{√π})integral_{(0...z)}[e^{(z2)}dt]
The terms in the power tower need to vary from x to 1 in a smooth manner with two asymptotes and an exponential bias. This is accomplished by the function:
g(x,z) = x^{((1+erf(2z1))/2)}
This function increases monotonically from 1 for z<<0 to x for z>>1, and most of the transition from 1 to x occurs in the range 0<z<1. Here are examples for x=2 and x=3:

All terms end up being between 1 and x, and there are none that are precisely equal to 1 or to x. However, they get arbitrarily close.
Then I define a finite approximation powertower:
T(x,y,n) = g(x,y) ↑ (g(x,y1) ↑ (g(x,y2) ↑ (... ↑ (g(x,yn+1)))))
for example: T(x,y,3) = g(x,y)↑(g(x,y1)↑g(x,y2))
Then finally, the first approximation to a realvalued hyper4 or "tetration" operator is:
x^{④}y ≈ H(x,y) = limit_{(n>infinity)} T(x,y,n)
Here are some examples:

Notice that when y is an integer, there are two terms (1.894 and 1.056 in this example) that are almost equivalent to an x. (But not exact: 1.894^{1.056} is a little less than 2; more on this later.)
Also notice that when y is a halfinteger, one of the terms is the square root of x and two others (1.997 and 1.002 in this example) just about "cancel out".
Finally, notice that the example for 2^{④}3 is the same as the one for 2^{④}2, except that all the values have moved up one step in the power tower.
Computer implemenation of this function yields the following values:

Immediately you should notice that H(3,1), H(2,3) etc. do not have the expected integer values. This results from the fact that the terms given by the g() function do not cancel out in the way that they need to, and for sufficiently low values of y, the first term is not x. To compensate for this, two techniques are used.
The first technique relies on the expected property that
x^{④}(y1) = log_{x}(x^{④}y)
The technique is to calculate x^{④}y2 for y2=y, or y2=y+1, or y2=y+2, using whatever value of y2 is high enough to ensure that the power tower has at least one term equal to x, then take the log of the result an appropriate number of times. More formally:
H2(x,y,0) = H(x,y),
H2(x,y,n) = log_{x}(H2(x,y+1,n1)) for n>0
and
x^{④}y ≈ H3(x,y) = limit_{(n>inf)} H2(x,y,n)
The second adjustment that needs to be done is to add a constant bias to y:
H4(x,y) = H3(x,y+K_{x})
The bias K_{x} depends on x but not on y; it corrects for the fact that the transition terms do not "cancel out" perfectly. To compute K_{x} any value of y can be used, for simplicity set y=1 and find the value of K_{x} such that H4(x,y)=x.
Results
Applying these techniques yields the following:

* In the second column, the entries that have * instead of a number represent values larger than 10^{2210}≈10^{10308}. This was the limit of my computer program, which handles large numbers by computing their logarithm to base 10; 10^{308} is the limit of IEEE doubleprecision floating point.
Other special values:
H4(e,0.5) = 1.654052630799
H4(e,e) = 3713.155056406
H4(e,π) = 4341201053.37
H4(π,0.5) = 1.750536646695
Although this function definition seems to work well, more work is needed before it can be considered a true extension of x↑↑y:
 The limit needs to be welldefined for arbitrarily large y. The error function converges quickly, but since it's being used for terms in a power tower, it might not converge fast enough if the power tower is tall. Due to this, even when the "bias" is perfectly adjusted for a small value of y the same bias will not produce the expected result for larger y. However, the formulas seem to behave well for the values I have tested, which all fall within the range 1 < x^{④}y < 10^{10308}.
 The bias is different for different values of x. For x greater than about 2.834 the bias is positive, otherwise it is negative. Beyond establishing that this crossover point is not e=2.71828... I have not investigated further. Perhaps there is a "better" g(x,z) would involve a function similar to the error function but with a slightly different shape so that a bias is not necessary. If the bias is unavoidable, a convincing argument of that fact would be needed.
 Further extension would be needed to handle y<1, x<1 or for complex x and y.
The PowerTower Paradox
This section is largely based on an earlier explanation I wrote specifically for HyperCalc entitled NonIntuitive Results When Working With Huge Numbers.
If you spend a while exploring the values of a↑↑b using an unlimitedrange program like HyperCalc, you will probably start noticing some paradoxical results and might even start to think the calculator is giving wrong answers.
For example, I will use HyperCalc to compute 27 to the power of googolplex:
Go ahead  just TRY to make me overflow! _ _ _ . . ._ _ ._ _ ._  _      ) (`  ( ,  ( ~ ~ 7 ~ ~' ~ ~ `~` ~ ~ ' Enter expressions, or type 'help' for help. C1 = googol = 10^100 R1 = googol: 1 x 10 ^ 100 C2 = googolplex = 10^googol R2 = googolplex: 10 ^ ( 1 x 10 ^ 100 ) C3 = 27^googolplex R3 = 10 ^ [ 10 ^ ( 1 x 10 ^ 100 ) ]Apparently HyperCalc thinks that
27^{1010100} = 10^{1010100}
This is clearly wrong — and it doesn't even seem to be a good approximation. What's going on?
First of all, note that HyperCalc, like any normal calculator, is trying to display all its answers in a form that involves using 10 as the base. A standard form like 10^{10...X} is useful because it makes different types of calculations easily comparable. A user might want to know which is bigger: 100! or 4^{44}. 100! is about 9.33×10^{157}. Is that bigger than 4^{44}? We need to either convert 100! to some power of 4, or convert 4^{44} to some power of 10. If you have a calculator that goes high enough, it will tell you that 4^{44} is about 1.34×10^{154}.
Let's assume that HyperCalc cannot be trusted and calculate the correct answer ourselves. In order to compare the two, we need to express them in terms of the same base. Let's use base 10, because one of the numbers, 10^{1010100}, is already expressed in terms of base 10. So we need to determine the values of A and B such that:
27^{1010100} = 10^{10A×10B}
The first step is express the power of 27 as a power of 10 with a product in the exponent, using the formula x^{y} = 10^{(log10(x)×y)} :
27^{1010100} = 10^{(log1027×1010100)}
log_{10}27 is about 1.4313637641589, so we have
27^{1010100} = 10^{1.4313637641589×1010100)}
Now we have a base of 10 but the exponent still needs work. The next step is to express the product as a sum in the nexthigher exponent; this time the formula we use is x×y = 10^{(log(x)+log(y))} :
10^{1.4313637641589×1010100} = 10^{10(log101.4313637641589 + 10100)}
log_{10}1.4313637641589 is about 0.1557500185891, and if we add this to 10^{100} we get
10^{10(0.1557500185891 + 10100)}
= 10^{101000...000.1557500185891}
= 10^{10(1.000...0001557500185891×10100)}
where there are 94 more 0's in place of each of the "...". Now we have:
27^{1010100} = 10^{10(1.000...0001557500185891×10100)}
again with 94 missing 0's.
Now we've expressed the value of 27^{googolplex} precisely enough to see HyperCalc's error — and look how small the error is! The error manifests as the digits "155" in "1.000...000155". To even be able to see this "155", we need to use 104 digits of precision because that "1.000...000155" is 104 digits long. In the original calculation giving 27^{1010100} = 10^{1010100}, HyperCalc used the default precision which is the native precision of the system, which is typically 16 digits of accuracy. Those 16 digits are taken up by the 1 and the first 15 0's — so when it gets to the step of adding 0.155 to 1.0×10^{100}, it just rounds off the answer to 1.0×10^{100}.
R3 = 10 ^ [ 10 ^ ( 1 x 10 ^ 100 ) ]
HyperCalc can also use the arbitraryprecision bc to do its math at higher precisions, accessed by setting the special variable scale. We can use that to get a more accurate answer for 27^{googolplex}. Here is the result:
C1 = scale=120 C1 = 27^(10^(10^100)) R1 = 10 ^ ( 1.43136376415898731186 x 10 ^ 10000000000000000000000000000000\ 000000000000000000000000000000000000000000000000000000000000000000000 )Two things happened here: Because 120 digits of precision have been specified, HyperCalc can now express googol exactly, so it displays it as a 1 followed by 100 zeros. This means in turn that we no longer get our desired values of A and B, but instead get the intermediate result 1.4313637641589×10^{10100} that we encountered during the derivation above.
To get the actual value of our desired A, we can take the logarithm to base 10 twice. Continuing the above session:
R1 = 10 ^ ( 1.43136376415898731186 x 10 ^ 10000000000000000000000000000000\ 000000000000000000000000000000000000000000000000000000000000000000000 ) C2 = log(%) R2 = 1.43136376415898731186 x 10 ^ 100000000000000000000000000000000000000\ 00000000000000000000000000000000000000000000000000000000000000 C3 = log(%) R3 = 100000000000000000000000000000000000000000000000000000000000000000000\ 00000000000000000000000000000000.1557500185891198647Here we went to 120 digits of precision to get an answer that is pretty close to the original paradoxical answer. That requires a fair amount of computational work, and if the original problem statement had been greater, it would take even more work. Resolving the difference between 27^{10101000000} and 10^{10101000000} would take over 1000000 digits of calculation, and resolving the difference between 27^{10101000000000000} and 10^{10101000000000000} would require over 1000000000000 digits. And clearly if we just add one more 10 to those towers of exponents, all hope of avoiding roundofferror is lost. This point is explored further on my large numbers page as part of the uncomparably larger discussion.
Finding Final Digits Using Modular Arithmetic
If you are interested in only the last few digits, values of X↑↑Y can be computed more easily. The algorithm is explained on my page for OEIS sequence a092188. If you want the last N digits, then it could take about 10^{N} steps to calculate the value of a powertower A^{BC...}, but typically it goes a little faster. Here is a little table:
Last 6 digits of x^^y, for 2<=x<=27 and 1<=y<=9 1 2 3 4 5 6 7 8 9 2^^ 000002 000004 000016 065536 156736 428736 748736 948736 948736 3^^ 000003 000027 484987 739387 355387 595387 195387 195387 195387 4^^ 000004 000256 084096 392896 208896 328896 728896 728896 728896 5^^ 000005 003125 203125 203125 203125 203125 203125 203125 203125 6^^ 000006 046656 878656 438656 238656 238656 238656 238656 238656 7^^ 000007 823543 132343 172343 172343 172343 172343 172343 172343 8^^ 000008 777216 126656 449856 945856 825856 225856 225856 225856 9^^ 000009 420489 177289 865289 945289 745289 745289 745289 745289 10^^ 000010 000000 000000 000000 000000 000000 000000 000000 000000 11^^ 000011 670611 906611 066611 666611 666611 666611 666611 666611 12^^ 000012 448256 094016 596416 172416 412416 012416 012416 012416 13^^ 000013 592253 549053 325053 645053 045053 045053 045053 045053 14^^ 000014 558016 651136 510336 782336 302336 502336 502336 502336 15^^ 000015 859375 859375 859375 859375 859375 859375 859375 859375 16^^ 000016 551616 255616 015616 415616 415616 415616 415616 415616 17^^ 000017 764177 229777 125777 485777 085777 085777 085777 085777 18^^ 000018 575424 542976 395776 315776 315776 315776 315776 315776 19^^ 000019 123979 459179 483179 363179 963179 963179 963179 963179 20^^ 000020 000000 000000 000000 000000 000000 000000 000000 000000 21^^ 000021 124421 492421 452421 652421 652421 652421 652421 652421 22^^ 000022 723584 785856 092096 608896 784896 104896 504896 504896 23^^ 000023 910567 988647 606247 078247 918247 718247 718247 718247 24^^ 000024 843776 014976 734976 734976 734976 734976 734976 734976 25^^ 000025 265625 265625 265625 265625 265625 265625 265625 265625 26^^ 000026 203776 203776 203776 203776 203776 203776 203776 203776 27^^ 000027 892803 403683 450083 242083 002083 802083 802083 802083For example, to find the last 6 digits of 9↑↑4 = 9^{9^{9^{9))), look in the 9^{th} row and the 4^{th} column, and find the digits 865289.
A Lifetime Interest in hyper4
A childhood obsession with the family of dyadic operators (increment, add, multiply, etc...) began in 1973 or 1974 when I was 9 or 10 years old. At age 12 or 13 I began trying to make slide rules to compute the "lower hyper4 function" defined by the leftassociative repetition of exponents: x_{④}y = (((x↑x)↑x)↑...)↑x — and did not succeed for the first few attempts. I discovered the formula x_{④}y=x↑(x↑(y1)) at age 14 and had a working slide rule a couple months later. In that part of my life (which I call "my classical period") I never could crack the rightassociative "higher hyper4 function", and the obsession eventually faded. The Mandelbrot set eventually took its place as my primary mathematical obsession.
By my late 30's I had seen common threads between some of the other generalized functions Gamma (for the factorials), Barnes' Gfunction (for the lower superfactorial), and the Kfunction (for the hyperfactorials).
Eventually I decided to just put the assumptions down on paper and manually construct a function that would meet all of them. What I have now is not wholly satisfactory because it requires an adjustment for the base.)
See Also
The hyper4 function is also discussed extensively on my large numbers page.
A171881: 0, 1, 1, 2, 1, 1, 3, 4, 1, 1, 4, 27, 16, 1, 1, 5, 256, 19683, 256, 1, 1, 6, 3125, 4294967296, 7625597484987, 65536, 1, 1, 7, 46656, 298023223876953125, 340282366920938463463374607431768211456, 443426488243037769948249630619149892803, 4294967296, 1, 1, 8, 823543, ...
A171882: 1, 1, 0, 1, 1, 1, 1, 2, 1, 0, 1, 3, 4, 1, 1, 1, 4, 27, 16, 1, 0, 1, 5, 256, 7625597484987, 65536, 1, 1, 1, 6, 3125, 13407807929942597099574024998205846127479365820592393377723561443721764030073546976801874298166903427690031858186486050853753882811946569946433649006084096, (next term is 3^{7625597484987}≈1.26*10^{3638334640024}), ...
Footnotes
2 : After growing tired of the exponentiation function I moved on to hyper4, for which I invented the name "powerlog". Because an 7^{th}year maths textbook I had been given defined exponentiation as: a^{b}=(..(a×a)×a...)×a, I decided to use the same type of definition for hyper4, with the result that I ended up working with the lower hyper4 function. I was in the 8^{th} grade (middle school) when I derived the identity a_{④}b=a^{a(b1)}; later in the same year I created a custom slide rule for calculating this function.
4 : if and only if... : Actually, there are multiple values of b such that b e^{b} is equal to a given value of a, but only if you are willing to have a and b be complex numbers.
HostMDS © 19962014 Robert P. Munafo. about contact mrob mrob27 @mrob_27
This work is licensed under a Creative Commons AttributionNonCommercial 4.0 International License. Details here.
This page was last updated on 2014 Nov 27. s.11