Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
1998
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1998

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

Search the Archive

Re: Help please: Summing a list

  • To: mathgroup at smc.vnet.net
  • Subject: [mg13500] Re: Help please: Summing a list
  • From: "W. K. Bertram" <wkb at ansto.gov.au>
  • Date: Fri, 31 Jul 1998 04:33:18 -0400
  • Organization: Australian Nuclear Science and Technology Organisation
  • References: <6pebm8$i6j@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

robpetersonSPAMME at iname.com wrote:

> I make a list of numbers, eg:
>
> P=Table[6,{x,0,110}]; (I have a more interesting list to use later if I
> get this working)
>
> Now I want to make another list PP in which each entry PP[[i]] is the
> sum of P's first i entries.  I try
>
> PP[[i]]:=Sum[P[[n]],{n,0,i}];

This will work;pp = Table[Plus @@ Take[p, i], {i, 1, 110}]

Cheers,
    Bill



  • Prev by Date: Re: Help please: Summing a list
  • Next by Date: Box manipulation
  • Previous by thread: Re: Help please: Summing a list
  • Next by thread: Subscript and the Sorcerer's Apprentice