Getting a sum of consecutive numbers using recursion