TOPICS
Search

TAK Function


The TAK function is a recursive function devised by I. Takeuchi in 1978 (Knuth 1998). For integers x, y, and z, it is defined by

 t(x,y,z)={y   for x<=y; t(t(x-1,y,z),t(y-1,z,x),t(z-1,x,y))   otherwise
(1)

This can be described more simply by

 t(x,y,z)={y   if x<=y; {z   if y<=z; x   otherwise   otherwise.
(2)

Let T(x,y,z) count the executions of the "otherwise" branch when the recursive definition is fully expanded, without reusing previously computed values. Then

 T(x,y,z)={0   for x<=y; 1+T(x-1,y,z)+T(y-1,z,x)+T(z-1,x,y)+T(t(x-1,y,z),t(y-1,z,x),t(z-1,x,y))   otherwise.
(3)

The total number of function calls is 1+4T(x,y,z) (Knuth 1991).

An auxiliary recurrence relation, related to the ballot problem, omits the last recursive call:

 V(x,y,z)={0   for x<=y; 1+V(x-1,y,z)+V(y-1,z,x)+V(z-1,x,y)   otherwise.
(4)

For integers a>b>0, it satisfies

V(a,b,0)=sum_(k=0)^(b)(a-b)/(a+b-2k)(a+b-2k; b-k)-1
(5)
=sum_(k=0)^(b-1)(a-b)/(a+b-2k)(a+b-2k; b-k).
(6)

(Knuth 1991).

The Takeuchi numbers are defined by T_n=T(n,0,n+1) for integers n>=0.


See also

Ackermann Function, Ballot Problem, Recursive Function, Takeuchi Number, Takeuchi-Prellberg Constant

Explore with Wolfram|Alpha

WolframAlpha

More things to try:

References

Finch, S. R. Mathematical Constants. Cambridge, England: Cambridge University Press, p. 321, 2003.Gabriel, R. P. Performance and Evaluation of LISP Systems. Cambridge, MA: MIT Press, 1985.Knuth, D. E. "Textbook Examples of Recursion." In Artificial Intelligence and Mathematical Theory of Computation, Papers in Honor of John McCarthy (Ed. V. Lifschitz). Boston, MA: Academic Press, pp. 207-229, 1991. https://arxiv.org/abs/cs/9301113.Knuth, D. E. The Art of Computer Programming, Vol. 2: Seminumerical Algorithms, 3rd ed. Reading, MA: Addison-Wesley, 1998.Knuth, D. E. The Art of Computer Programming, Vol. 3: Sorting and Searching, 2nd ed. Reading, MA: Addison-Wesley, 1998.Vardi, I. "The Running Time of TAK." Ch. 9 in Computational Recreations in Mathematica. Redwood City, CA: Addison-Wesley, pp. 179-199, 1991.

Referenced on Wolfram|Alpha

TAK Function

Cite this as:

Weisstein, Eric W. "TAK Function." From MathWorld--A Wolfram Resource. https://mathworld.wolfram.com/TAKFunction.html

Subject classifications