MathGroup Archive 1998

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

Search the Archive

Re: Can it be done - easily?

  • To: mathgroup at
  • Subject: [mg13257] Re: Can it be done - easily?
  • From: "Clemens Frey" <clemens.frey at>
  • Date: Fri, 17 Jul 1998 03:17:50 -0400
  • Organization: University of Bayreuth, Department of Mathematics and Computer Science
  • References: <6od25q$>
  • Sender: owner-wri-mathgroup at

Barry Culhane wrote in message <6od25q$hn9 at>...
>Myself and two workmates are software developers.  One guy wanted a
>formula to calculate a result for the following equation...
>     Z = sum of X/Y where X is a fixed number, and Y ranges from A-B in
>fixed steps...
>     i.e... X=10000 ; Y=100,200,300...1000
>     i.e... Z= 10000/100 + 10000/200 + ... 10000/1000 =  292.896
> ...

Hi Barry,
it can be done - easily.
if you have a stepsize, a starting value, end value (all three defining 
y), and a factor x, you can instruct Mathematica to calculate

f[x_,start_,end_,step_] := NSum[x/y,{y,start,end,step}]];

You can investigate the time consumed by this by, e.g. :

Timing[  f[1,1,10^6,1]  ]

{0.05 Second, 14.3927}

So: easy and fast...


  • Prev by Date: Re: Default format for new cells
  • Next by Date: Graphics: How to Fix Frame Size ?
  • Previous by thread: Re: Can it be done - easily?
  • Next by thread: Re: Can it be done - easily?