Task 7: Recursion with reduce