I would like to ask how to calculate an approximation for simple geometric series (examples bellow) using R and without loops.
1-(1/3)+(1/5)-(1/7)+(1/9)-(1/11)
1+(1/3^2)+(1/5^2)+(1/7^2)+(1/9^2)
I have no idea how to calculate approximation for geometric series using R, although it might be quite simple. Please help me :)
I tried to create a function, but because I'm not familiar with geometry itself I failed.