Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2007
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2007

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

Search the Archive

fastest way to add up a billion numbers

  • To: mathgroup at smc.vnet.net
  • Subject: [mg73880] fastest way to add up a billion numbers
  • From: "Raj" <rajanikanth at gmail.com>
  • Date: Fri, 2 Mar 2007 06:41:46 -0500 (EST)

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: monomials in Graded Lexicographic Order and associated factorials
  • Next by Date: need MathLie mathematica package
  • Previous by thread: Re: Re: Means
  • Next by thread: Re: fastest way to add up a billion numbers