MathGroup Archive 2006

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

Search the Archive

Re: product formula in mathematica

  • To: mathgroup at
  • Subject: [mg68797] Re: product formula in mathematica
  • From: Peter Pein <petsie at>
  • Date: Fri, 18 Aug 2006 03:13:00 -0400 (EDT)
  • References: <ec19d4$oie$>
  • Sender: owner-wri-mathgroup at

frou schrieb:
> 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.
> Thanks
The first method works for arbitrary lists:
In[1]:= Times@@(f/@{1,3,4,9})
Out[1]= f[1] f[3] f[4] f[9]

and the second is very specialized ;-)

In[2]:= Product[f[FromDigits[IntegerDigits[k,2],3]],{k,4}]
Out[2]= f[1] f[3] f[4] f[9]

(just kidding - sorry)


  • Prev by Date: RE: question?
  • Next by Date: Re: Several functions in a single 2D-plot
  • Previous by thread: Re: product formula in mathematica
  • Next by thread: RE: product formula in mathematica