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

6 5/10 as improper fraction
what years did the cattle drives take place from
How do you say "Some brown spiders"?
After his paycheck, Mr.Weber's credit card balance was $245.76. His payment was for $75.00. Write and solve an equation to find the amount of his credit card
A bottle of fruit juice is 800 milliliters. How many liters of fruit juice are in 120 bottles?
Which fraction is equivalent to 2/7
15 is 70% of what number
why did texans drive their cattle to towns in the midwest
Simplify. 26 + (–3) ∙ (–8) A. –184 B. –2 C. 2 D. 50
What is x^2+8x-5 in vertex form? Please explain.