MathGroup Archive 2011

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

Search the Archive

Re: How to create such a list

  • To: mathgroup at smc.vnet.net
  • Subject: [mg118465] Re: How to create such a list
  • From: Sseziwa Mukasa <mukasa at gmail.com>
  • Date: Fri, 29 Apr 2011 07:30:23 -0400 (EDT)

On Apr 28, 2011, at 6:37 AM, Dominic Woerner 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?

I don't know about neatness but

Plus@@@Subsets[Table[w[i],{i,n}]]

will do what you want when n has a value.

Regards,
	Sseziwa


  • Prev by Date: Re: How to create such a list
  • Next by Date: Re: How to create such a list
  • Previous by thread: Re: How to create such a list
  • Next by thread: Re: How to create such a list