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

Choose the sentence with no errors in punctuation or capitalization. (Points : 1) "Why are they singing "Old MacDonald's Farm" again?" she asked
explain why most mutations in eukaryotes are recessive
where is the homeland of the Burgundians
the area of a parallelogram os 150 square meters the height of the parallelogram is 15 meters what is the length of the parallelogram
Illiad and Odyssy help please In the Odyssey, why does Penelope weave a shroud each day and then unweave it each night? A. Since she promised to bury Odysseus
please help me on a problem on world history. I need to know what is the nickname and why
14 line sonnet poem 10 syllables per line about something I hate witch is math.
Which sentence does not contain any errors in comma usage. A.Mr.Morrish my new scout master, is from lreland. B.Suzie, my best friend, is also an amazing athlet
what does mutualism and commensalism have in common
The prefix in the word abnormal means— a across b between c not; away from d two