series of powers of integer powers

91 Views Asked by At

Given two real positive numbers $a,b\in(0,\infty)$ and a series of natural integers $n=1,2,3,\dots$, is there any known formula to apply in order to calculate the series $$s(n)=a^{b^n}?$$

My goal is not to use $\text{pow}(a,b^n)$ or exponential functions in a piece of software I'm writing.

I try to be clearer: Suppose my algorithm is

given a real positive number "a":

  1. for n=1,N
  2. sn=a^n
  3. use sn in some way
  4. end for

Nobody would implement the second line like : sn=pow(a,n) because calling pow() is time consuming. Anyone would instead code line 2 like this : sn=a*sn.

Now, unfortunately my case is more involved, as I have the following algorithm

  1. for n=1,N
  2. sn=a^(b^n)
  3. use sn in some way
  4. end for

I'm trying to find out a similar cheaper solutino to compute sn without calling pow() or exp() functions.

Thank you

renato