MathGroup Archive 2010

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

Search the Archive

Re: "Accumulate" with operator Times.

  • To: mathgroup at smc.vnet.net
  • Subject: [mg114876] Re: "Accumulate" with operator Times.
  • From: Murray Eisenberg <murray at math.umass.edu>
  • Date: Tue, 21 Dec 2010 00:19:06 -0500 (EST)
  • References: <201012200540.AAA22768@smc.vnet.net>
  • Reply-to: murray at math.umass.edu

I don't know of a named, built-in function exactly parallel to 
Accumulate. But FoldList will do it, of course:

    lis = {a, b, c};
    FoldList[Times, First@lis, Rest@lis]

(Accumulate is a relative newcomer to Mathematica, having appeared only 
in version 6.))

On 12/20/2010 12:40 AM, Matthias Bode wrote:
> Hola:
>
> In[5]:= Accumulate[{a, b, c}]  yields
>
> Out[5]= {a, a + b, a + b + c}
>
> Is there a simple command, similar to Accumulate, that yields
>
> {a, a*b, a*b*c} ?
>
> Best regards,
>
> MATTHIAS BODE
> S 17.35775=B0, W 066.14577=B0
> 2'740 m
> AMSL.
>

-- 
Murray Eisenberg                     murray at math.umass.edu
Mathematics & Statistics Dept.
Lederle Graduate Research Tower      phone 413 549-1020 (H)
University of Massachusetts                413 545-2859 (W)
710 North Pleasant Street            fax   413 545-1801
Amherst, MA 01003-9305


  • Prev by Date: Re: "Accumulate" with operator Times.
  • Next by Date: Mathematica 8 Executable (how much gets added to them)
  • Previous by thread: Re: "Accumulate" with operator Times.
  • Next by thread: Re: "Accumulate" with operator Times.