JoeM3388 JoeM3388
  • 03-04-2015
  • Computers and Technology
contestada

Give a recursive algorithm for finding the sum of the
first n odd positive integers.

Respuesta :

Hippalectryon
Hippalectryon Hippalectryon
  • 03-04-2015
I'm writing that in some sort of pseudocode; if you don't understand it, feel free to ask for more details in the comments.

function sumOdd(n)
    if n==1 then
        return 1
    end if
    return (sumOdd(n-1))+(n*2-1)
end function
Answer Link

Otras preguntas

How long does water evaporation take? What factors influence it?
Why can't plants and animals use the nitrogen directly from the atmosphere? Answer A.There is not enough of it in the air. B.Nitrogen gas contains the element i
Write good insulators around the home
What does el muslo mean?
one way that animals adapt to seasonal change
What events began and ended athens' golden age??
reduce 15 1/4 +1 1/2 +3/20 to lowest term.
The areas of two circles are 36(pi) and 64(pi). What is hte ratio of the diameters? of the circumferences?
How many months is 0.75 of a year
What is the value of 6P6?  A.1  B.36  C.720  D.46,656