MathGroup Archive 2006

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

Search the Archive

Re: a simple product, but with "i = 1...n AND i != x"

  • To: mathgroup at smc.vnet.net
  • Subject: [mg70258] Re: a simple product, but with "i = 1...n AND i != x"
  • From: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>
  • Date: Tue, 10 Oct 2006 06:12:10 -0400 (EDT)
  • Organization: The Open University, Milton Keynes, UK
  • References: <egcok5$je2$1@smc.vnet.net>

xarnaudx at gmail.com wrote:
> hi,
> i would like to make a function like
> f[x_] := Product[x - i, {i, 1, n} AND i != x}
> 
> obviously, the end of the expression is syntactically incorrect. But
> how to rewrite this product correctly?
> thanks
> 

You could try something along the line

f[x_] := Product[If[i != x, x - i, 1], {i, 1, n}]

Regards,
Jean-Marc


  • Prev by Date: Re: a simple product, but with "i = 1...n AND i != x"
  • Next by Date: Re: a simple product, but with "i = 1...n AND i != x"
  • Previous by thread: Re: a simple product, but with "i = 1...n AND i != x"
  • Next by thread: Re: a simple product, but with "i = 1...n AND i != x"