Run ❯
Get your
own
website
×
Change Orientation
Change Theme, Dark/Light
Go to Spaces
tri_recursion <- function(k) { if (k > 0) { result <- k + tri_recursion(k - 1) print(result) } else { result = 0 return(result) } } tri_recursion(6)
[1] 1
[1] 3
[1] 6
[1] 10
[1] 15
[1] 21