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

who is credited as the inventor of the movie?a. Herbert Kalmus b. Leland Stanford c. The Lumiere Brothers d. Thomas Edison
Jake has already written 3 pages, and he expects to write 1 page for every additional hour spent writing. Write an equation that shows the relationship between
Write an expression to describe a rule for the sequence. Then solve for the 100th term. -4, 1, 6, 11, 16, . . .
he ages of four groups of workers are shown. Which group has the largest range?
What is the square root of 69?
andre rode his bicycle to a park located 5 1/2 miles from his house. he returned along the same route. after 7 1/3 miles total, how many more miles does Andre n
Gary ran 7 miles in 55 minutes what his rate of speed in miles per minutes
0.63 =1.00 0.634 plus what equals a dollar
Given: 2x + 3y = 6. What is the y-intercept? (0, 3) (2, 0) (0, 2) no intercept
what are 2 things that lyddie appreciates about living in a boarding house