How can I define a function that raises a number to the power of itself a given number of times?

172 Views Asked by At

We can use the following to add the number $2$ to itself $5$ times.

$$f(n,k) = \sum_{x=1}^k n = n\cdot k$$

$$2 + 2 + 2 + 2 + 2 = f(2,5) = \sum_{x=1}^5 2 = 2\cdot 5 = 10$$

We can use a similar strategy for multiplying the number $2$ by itself $5$ times.

$$g(n,k) = \prod_{x=1}^k n = n^k$$

$$2\cdot2\cdot2\cdot2\cdot2 = g(2,5) = \prod_{x=1}^5 2 = 2^5 = 32$$

How could I define $h(n,k)$ such that $h(2,5) = 2^{2^{2^{2^2}}}$?

2

There are 2 best solutions below

1
On BEST ANSWER

Thanks to the tag added in Ivan Neretin's edit, I have found that this operation is formally known as "tetration".

In mathematics, tetration (or hyper-4) is the next hyperoperation after exponentiation, and is defined as iterated exponentiation.

$h(n,k)$ would be defined as follows, using standard tetration format.

$$h(n,k) = ^kn$$

0
On

Knuth Arrow notation, best explained here.

It also has accommodations for repeated knuth arrow notations, repeated REPEATED knuth arrows, and so on into the sun.