So I want to find the sum of this expression:
1 +(2 /3)+(2/3)(4/5)+(2/3)(4/5)(6/7)+...+((2/3)(4/5)...*38/39)
without using any loops only with vector calculations.
So my general approach is to create the sequence: z=1, 2/3 , 4/5 ...38/39
x=c(1,seq(2,38,2)) ; y=c(1,seq(3,39,2)) ; z=x/y
So I have my sequence z but now i want to create the original expresion meaning that each current term of z is the term multiplied with all each previous terms.To do that i wrote:
n=length(z) ; i=2:n
z[i]=z[i]*z[i-1]
but it doesn't work.Any ideas of how to approach this?