Sandra Ross - 4 months ago 13
R Question

# Sum with the R software

I would like to compute:

$\sum_{j=1}^n r^j$ for $n=10, 20, 30, 40$, where $r=1.08$


and to see the answers as a vector. I'm working with R; could anyone is able to explain to me how to do this?

r = 5.3; for (n in c(10,20,30,40) ) print( sum( r^(1:n) ) )