Why is my recursive function so slow in R? Why is my recursive function so slow in R? r r