Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2010

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

Search the Archive

Re: "Accumulate" with operator Times.

  • To: mathgroup at smc.vnet.net
  • Subject: [mg114863] Re: "Accumulate" with operator Times.
  • From: Matthias Bode <lvsaba at hotmail.com>
  • Date: Tue, 21 Dec 2010 00:16:44 -0500 (EST)
  • References: <iemq88$m7m$1@smc.vnet.net>,<4D0F217F.6050606@KevinMcCann.com>

Hola:

I tried

"Accumulate[{a, b, c}] /. Plus -> Times"

before, it does work with {a,b,c}.

BUT

Accumulate[{2, 4, 5}] /. Plus -> Times  yields

{2, 6, 11}.

It appears that I am relegated to my pedestrian

In[97]:= lst02 = {2, 4, 5};
  Table[Times @@ Take[lst02, n], {n, 1, Length[lst02]}]

Out[97]= {2, 8, 40}

Best regards,

MATTHIAS BODE
S 17.35775=B0, W 066.14577=B0
2'740 m
AMSL.
 > Date: Mon, 20 Dec 2010 04:27:27 -0500
> From: kjm at KevinMcCann.com
> To: lvsaba at hotmail.com
> Subject: Re: "Accumulate" with operator Times.
> To: comp-soft-sys-math-mathematica at moderators.isc.org
>
> How about
>
> Accumulate[{a, b, c}] /. Plus -> Times
>
> Kevin
>
> 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.
> >
 		 	   		  =


  • Prev by Date: Re: switching between versions 7 and 8
  • Next by Date: Re: bibtex support in Mathematica 8
  • Previous by thread: Re: "Accumulate" with operator Times.
  • Next by thread: Re: "Accumulate" with operator Times.