[R] How to do an infinite sum in R

David Winsemius dwinsemius at comcast.net
Fri Nov 16 22:18:47 CET 2012


On Nov 16, 2012, at 9:30 AM, Simon Bolivar wrote:

> I'm having trouble to do an infinite sum in R
> 
> I want to do the infinite sum of 1/(1+n)
> 
> how would I do this in R?

You could try submitting this job:

sum(1/(1+1:(2^31-1) ) )  # 2^31-1 being the highest integer in R at the moment

After I consumed all of the physical space in my 32GB memory and paged out to virtual memory (something I was not surprised about)  with this action, I killed my R session. You could also see if you got better answers from a symbolic algebra program.

-- 
David Winsemius, MD
Alameda, CA, USA




More information about the R-help mailing list