def f(n): if n == 0: 0 else: n + f(n - 1) end end f(5)