radomes.openskiesproject.org
JoeM3388 JoeM3388
  • 03-04-2015
  • Computers and Technology
Answered

Give a recursive algorithm for finding the sum of the

first n odd positive integers.

Verified Answer :

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

Related Questions

To have the means to buy a car means you do not have enough money True or falseSelect oneO TrueO False
I need help with problem 38 please
How did the surpreme Courts decisions harm the efforts of reconstruction
Which sentence uses a verb that agrees with its subject A The new volunteers at the fire station are waiting for their first call B Four players on the team is
An element has two stable isotopes 1 64928 amu and 3083 abundant 2 62930 amu and 6917 abundant What is the average atomic mass of the element amu Average Atomic
On Friday 500 people watched a film at the cinema 70 of these people were children On Saturday 720 people watched the film at the cinema 5 8 of these people wer
How did european exploration help lead the way to the scientific revolution
ok ok can anyone please help this miserable individual complete this asssignment in the app of current event events newsela actually just the quiz part for Chao
Write three numbers that when rounded to the nearest hundredth78
Sí yo a pensar en la última competencia de atletismo mucho me vuelo loco a te pones b se pone c me pongo