JoeM3388 JoeM3388
  • 03-04-2015
  • Computers and Technology
Answered

Give a recursive algorithm for finding the sum of the
first n odd positive integers.

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

Other Questions

What is the fraction ten fourteenths in it simplest form
What is 18 13 as a decimal
Which event contributed to the defeat of British troops in the South a The Patriots improved at waging conventional warfare b British troops lost interest in t
When dissolved in water an Arrhenius base yields1 hydrogen ions 2 hydronium ions3 hydroxide ions 4 oxide ions
How do I find the Greatest Common Factor of 7z11 56z9 63z8I think it is 7 but cannot figure out the variable exponentHELP
Which two compounds are isomers of each other 1 CH3CH2COOH and CH3COOCH2CH3 2 CH3CH2CHO and CH3COCH3 3 CH3CHBrCH3 and CH2BrCHBrCH3 4 CH3CHOHCH3 and CH3CHOHCH2OH
Susan Run to school because she was late
Fifty pounds of a cementandsand mixture is 40 sand How many pounds of sand must be added for the resulting mixture to be 60 sand
Toby has 36 pieces of fruit and 23 of the fruit pieces are apples How many apples does Toby have
how was the hindu belief about karma related to the caste system