# Mathematical function for the powers

I have this formula $$\underbrace{2^{2^{2^{.^{.^{.^{2^2}}}}}}}_n$$i.e. where the total number of 2's is $n$.

Is there any way to write it as a single mathematical function?

-
You might want to ask this in the Tetration Forum – Pedro Tamaroff Feb 19 '12 at 5:13
FWIW, repeated exponentiation is called tetration. – JavaMan Feb 19 '12 at 5:20
I know it as the tower function/operator. – Raphael Feb 19 '12 at 12:05

Knuth invented a notation for these kinds of expressions, called "up-arrow notation".

To express the power tower in your question with up-arrow notation, we can simply write $2\uparrow\uparrow n$.

-
thanks a lot, that's what I needed – Sergey Feb 19 '12 at 5:06
No problem, glad to help. – Zev Chonoles Feb 19 '12 at 5:08

Yes, using Knuth's up-arrow notation. In your case, $2\uparrow\uparrow n$.

-

According to this definition you can define this number as :

$$^n2 = \begin{cases} 1, & \text{if }n=0 \\ 2^{[^{n-1}2]}, & \text{if }n>0 \end{cases}$$

-