Some recursion exercises in Ruby