Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2006
*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 2006

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

Search the Archive

RE: product formula in mathematica

  • To: mathgroup at smc.vnet.net
  • Subject: [mg68757] RE: [mg68702] product formula in mathematica
  • From: "David Annetts" <davidannetts at aapt.net.au>
  • Date: Fri, 18 Aug 2006 03:12:01 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

Hi,

> Hi I am interested in doing a product over a set of indices 
> that are not continuous
> Product [ f(x_i) , { x_i, 1,3,4,9}]     Is this possible it appears
> that the iterator wouldonly take sequences such as 1...10 etc.

Depends exactly what you want ....

There is a form of the product function that takes a step, eg.

	Product[i, {i, 1, 10, 2}]

However, if you want something particularly unusual, then you can simulate
Product by applying Times[] to a list, eg.

	Times @@ Range[1, 10, 2]

Or

	Times @@ (# &) /@ {2, 3, 5, 7, 11, 13, 17, 19}

Which should be the same as

	Product[Prime[x], {x, 8}]

Regards,

Dave.


  • Prev by Date: Re: distance function
  • Next by Date: RE: product formula in mathematica
  • Previous by thread: Re: product formula in mathematica
  • Next by thread: RE: product formula in mathematica