Using recursion and equations, write a definition of function sumOdds(n), which produces the sum of the odd integers that are less than or equal to n. Assume that n is an odd positive integer. For example, sumOdds(3) = 1 + 3 = 4, and sumOdds(7) = 1 + 3 + 5 + 7 = 16. Use recursion.

(Hint. For n = 1, just say what the answer is. For n > 1, look for a smaller problem of the same kind that will help you, and use the same function to solve that smaller problem.)

 

    [Language: Cinnameg  Kind: function definition*]

(*You can define more than one function if you put a semicolon between definitions (but not between cases of one definition). Be sure to define a function before you use it.)