MathGroup Archive 2006

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

Search the Archive

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


In[1]:= f[x_] := Times @@ (x - #1 & ) /@ DeleteCases[Range[n], x]

In[2]:= n = 5; f[y]
Out[2]= (-5 + y)*(-4 + y)*(-3 + y)*(-2 + y)*(-1 + y)

In[5]:= n = 5; f[4]
Out[5]= -6

Adriano Pascoletti

On 9 ott 2006, at 07:55, 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
>


  • 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: 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"