Calculate Knuth's up arrow notation Inspired by Expand exponentation.
Knuth's up arrow notation is used for big numbers such as Graham's number.
If we look deeper, we can see how it makes big numbers.
One arrow means exponentiation. e.g. 2↑3 equals 2^3 = 8.
Two or more arrows means repeating the instructions of n-1 arrows. e.g. 2↑↑3 equals 2↑2↑2 equals 2^(2^2)=16.
You will be given three integers, n, a, and m. n is the first number, a is the amount of arrows, and m is the second number.
Your code should output the final answer, which is the calculation of n ↑a m(↑x means there are x up-arrows, where x is an integer)
Examples
2 1 2 -&gt; 4
2 1 3 -&gt; 8
2 2 3 -&gt; 16
2 3 3 -&gt; 65536
Java 7, 121 bytes
int c(int n,int a,int m){return(int)(a&lt;2?Math.pow(n,m):d(n,a));}double d(int n,int a){return Math.pow(n,a&lt;2?n:d(n,a-1));}

Explanation:
int c(int n, int a, int m){         // Main method with the three integer-parameters as specified by OP's challenge
  return (int)                      // Math.pow returns a double, so we cast it to an integer
          (a &lt; 2 ?                  // if (a == 1):
                   Math.pow(n, m)   //  Use n^m
                 :                  // else (a &gt; 1):
                   d(n, a));        //  Use method d(n, a)
}

double d(int n, int a){             // Method d with two integer-parameters
  return Math.pow(n, a &lt; 2          // n ^ X where
                      ? n           //  X = n    if (a == 1)
                      : d(n, a-1)); //  X = recursive call d(n, a-1)    if (a &gt; 1)
}

// In pseudo-code:
c(n, a, m){
  if a == 1: return n^m
  if a &gt; 1:  return d(n, a);
}
d(n, a){
  if a == 1: return n^n
  if a &gt; 1:  return d(n, a-1);
}

Test code:
Try it here.
class M{
  static int c(int n,int a,int m){return(int)(a&lt;2?Math.pow(n,m):d(n,a));}
  static double d(int n,int a){return Math.pow(n,a&lt;2?n:d(n,a-1));}

  public static void main(String[] a){
    System.out.println(c(2, 1, 2));
    System.out.println(c(2, 1, 3));
    System.out.println(c(2, 2, 3));
    System.out.println(c(2, 3, 3));
  }
}

Output:
4
8
16
65536