Evaluating Knuth's arrow notation in a function
<p>I am having trouble calculating <strong>Knuth's arrow notation</strong>, which is ↑ and can be found <a href="https://en.wikipedia.org/wiki/Knuth%27s_up-arrow_notation" rel="nofollow">here</a>, within a function. What I've made so far is:</p>

<pre><code>int arrowCount = (int)arrowNum.Value; // Part of
BigInteger a = (int)aNum.Value;       // the input I
BigInteger b = (int)bNum.Value;       // already have
BigInteger result = a;
BigInteger temp = a;
for(int i = 0; i &lt; arrowCount; i++)
{
    result = Power(temp, b);
    temp = r;
    b = a;
}
</code></pre>

<p>with power being</p>

<pre><code>BigInteger Power(BigInteger Base, BigInteger Pow)
    {
        BigInteger x = Base;
        for(int i = 0; i &lt; (Pow-1); i++)
        {
            x *= Base;
        }
        return x;
    }
</code></pre>

<p>but it's incorrect with it's values and I can't figure out a way to fix it. It can handle 1 arrow problems like <strong>3↑3</strong> (which is <strong>3^3</strong> = <strong>9</strong>), but it can't handle any more arrows than that. </p>

<p>I need a way to <strong>figure out more arrows</strong>, such as <strong>3↑↑3</strong>, </p>

<p>which should be <strong><em>7625597484987 (3^27)</em></strong> and I get <strong><em>19683 (27^3)</em></strong>. If you could help me to figure how I could get the proper output and explain what it is I'm doing wrong, I would greatly appreciate it.</p>