Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #1992 > unrolled thread

Re: How to create such a list

Started byAlexei Boulbitch <alexei.boulbitch@iee.lu>
First post2011-04-29 11:34 +0000
Last post2011-04-29 11:34 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  Re: How to create such a list Alexei Boulbitch <alexei.boulbitch@iee.lu> - 2011-04-29 11:34 +0000

#1992 — Re: How to create such a list

FromAlexei Boulbitch <alexei.boulbitch@iee.lu>
Date2011-04-29 11:34 +0000
SubjectRe: How to create such a list
Message-ID<ipe7oj$r3e$1@smc.vnet.net>
Hi, Dominic,

The function below seems to make what you are looking for:

accumulatedList[n_Integer] :=
   Prepend[Table[w[i], {i, 1, n}] // Accumulate, 0];

accumulatedList[5]

{0, w[1], w[1] + w[2], w[1] + w[2] + w[3], w[1] + w[2] + w[3] + w[4],
  w[1] + w[2] + w[3] + w[4] + w[5]}


Have fun, Alexei



Hi,

I like to create a list of the form:
0,w[1],...,w[n],w[1]+w[2],...,w[1]+w[n],w[2]+w[3],......,w[1]+...+w[n]
for arbitrary n
Is there a neat way to do this?

Cheers,
Dominic

-- 
Alexei Boulbitch, Dr. habil.
Senior Scientist
Material Development

IEE S.A.
ZAE Weiergewan
11, rue Edmond Reuter
L-5326 CONTERN
Luxembourg

Tel: +352 2454 2566
Fax: +352 2454 3566
Mobile: +49 (0) 151 52 40 66 44

e-mail: alexei.boulbitch@iee.lu

www.iee.lu

--

This e-mail may contain trade secrets or privileged, undisclosed or
otherwise confidential information. If you are not the intended
recipient and have received this e-mail in error, you are hereby
notified that any review, copying or distribution of it is strictly
prohibited. Please inform us immediately and destroy the original
transmittal from your system. Thank you for your co-operation.

[toc] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web