# La funciĆ³n de Takeuchi en R tak <- function(x,y,z) { if (x <= y) return (y) return (tak(tak(x - 1, y, z), tak(y - 1, z, x), tak(z - 1, x, y))) } # Eficiencia # > system.time(tak(16,6,1), gcFirst = TRUE) # user system elapsed # 0.049 0.007 0.060 # # > tak(900,6,1) # Error: C stack usage 8284500 is too close to the limit