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

Please help! Urgent! Math! Will mark brain
3√ 64/1331 Please help and fast
How do you calculate 1/9 of 3/8?
_______ is a practice of emphasizing someone's positive qualities and focusing less on their negative ones.
Hannah and Corrine are playing a game by rolling two cubes, each numbered 1 through 6. If the sum of the numbers on the cubes is 7, Hannah wins. If the sum is n
multiply each set of numbers and match it with it’s product
Explain why the phrase in this sentence is nonrestrictive, or nonessential to the sentence: My youngest brother, Julian, is already taller than I am.
asap here plz I'm lost at this equation ​
An individual is more likely to report a crime than a group of people. What is this phenomena called? A. The group impact B. The mob mentality C. The witness im
Help on number seven please?​