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


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

Re: How to create such a list

Started byDrMajorBob <btreat1@austin.rr.com>
First post2011-04-29 11:32 +0000
Last post2011-04-29 11:32 +0000
Articles 1 — 1 participant

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


Contents

  Re: How to create such a list DrMajorBob <btreat1@austin.rr.com> - 2011-04-29 11:32 +0000

#1982 — Re: How to create such a list

FromDrMajorBob <btreat1@austin.rr.com>
Date2011-04-29 11:32 +0000
SubjectRe: How to create such a list
Message-ID<ipe7jj$qv8$1@smc.vnet.net>
n = 5;
Total /@ Subsets[Array[w, n]]

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

Bobby

On Thu, 28 Apr 2011 05:37:16 -0500, Dominic Woerner  
<dominic.woerner@mpi-hd.mpg.de> wrote:

> 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
>


-- 
DrMajorBob@yahoo.com

[toc] | [standalone]


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


csiph-web