I am trying to solve the following recurence program.
http://en.wikipedia.org/wiki/Hyper_operator
Here is my code. I know it has mistakes, but I have done what I could.
public class hyper {
public static int Hyper(int a, int b, int n) {
int t=0;
if (n == 0)
return b+1;
if ((n == 1) && (b == 0))
return a;
if ((n == 2) && (b == 0))
return 0;
if ((n >= 3) && (b == 0))
return 1;
t = Hyper(a, b-1, n);
return Hyper(a, t, n-1);
}
public static void main(String[] args) {
int n=3;
int a=5;
int b=7;
System.out.println(Hyper(a, b, n));
}
}