MathGroup Archive 2007

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: fastest way to add up a billion numbers


Sum[n,{n,m}]/.m->10^9

500000000500000000


Bob Hanlon

---- Raj <rajanikanth at gmail.com> wrote: 
> hi!
> 
> Could somebody tell me what would be the fastest way to add up a
> billion numbers(from 1 to 10^9 i.e the first billion numbers) in
> Mathematica?
> 
> Ofcourse the answer is n(n+1)/2, but is there any other way in
> Mathematica other than the following one:
> 
> Total@@Range[10^9]
> 
> Thanks,
> 
> Raj
> 



  • Prev by Date: Re: Means
  • Next by Date: Re: change filename automatically in Export Command
  • Previous by thread: Re: fastest way to add up a billion numbers
  • Next by thread: Re: fastest way to add up a billion numbers