Last active
August 29, 2015 14:19
-
-
Save hellonico/94b751cbcd124b0dc74c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Tak { | |
static long number = 0; | |
public static long tak(long x, long y, long z) { | |
if (x <= y) | |
return y; | |
else | |
number ++; | |
return | |
tak(tak(x-1, y, z),tak(y-1, z, x),tak(z-1, x, y)); | |
} | |
public static long takeuchi_number(int n) { | |
number = 0; | |
tak(n,0,n+1); | |
return number; | |
} | |
public static void main(String[] args) { | |
System.out.println(takeuchi_number(10)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment