# The best method of constructing a product of consecutive terms

I am new to Mathematica, I am searching for a way to create an expression with a sequence of terms such as:

(x-1)/x  (x-2)/x  (x-3)/x  (x-4)/x … (x-n)/x

• Seems like you want Product[(x - i)/x, {i, n}], which yields (-(1/x))^n Pochhammer[1 - x, n] Commented Mar 26, 2013 at 19:26
• Please come here chat.stackexchange.com/rooms/8082/the-newbie-reception Commented Mar 26, 2013 at 19:49

Since you are looking for the best method try symbolic capabilities of Mathematica, so this is the recommended way to go :

Product[(x - i)/x, {i, n}]

(-(1/x))^n Pochhammer[1 - x, n]


this result might be represented in a different way e.g. using FunctionExpand with TraditionalForm :

Product[(x - i)/x, {i, n}] // FunctionExpand // TraditionalForm


i.e. we have expressed the Pochhammer function in terms of the Euler gamma function. In general one could use simply indefinite Product (since the ver.7 there are also indefinite sums and product), however we have to remember that the convention is the following e.g.

Product[n, n]

(-1 + n)!


instead of n! as one might expect so using an indefinite product would be more complicated to get the result.

Another ways (though not so elegant) use e.g. lists e.g. Table or Range but then you have to replace a formal variable n by a natural number, e.g. :

Times @@ ((x - Range[n /. n -> 10])/x)
Unevaluated[ Times @@ ((x - Range[n])/x) == (Product[(x - i)/x, {i, n}])] /. n -> 10

((-10 + x)(-9 + x)(-8 + x)(-7 + x)(-6 + x)(-5 + x)(-4 + x)(-3 + x)(-2 + x)(-1 + x))/x^10

True


while with Product one can operate on a purely symbolic level.

We had to enclose the equality in Unevaluated for several reasons, to examine what might go wrong try to use it without Unevaluated. I recommend to take a closer look at the evaluation sequence of the last code line, e.g.

Unevaluated[ Times@@((x - Range[n])/x) == (Product[(x - i)/x, {i, n}])] /.n -> 10 //Trace

• Thank you very much. That is exactly what I was looking for! Commented Mar 27, 2013 at 15:25
• I'd have used x^-n FactorialPower[x - 1, n] or n! x^-n Binomial[x - 1, n] myself... Commented Jun 14, 2013 at 20:02
• Product[(x - i)/x, {i, n}] is a bit simpler if we are pleased with Pochhammer. Commented Jun 14, 2013 at 20:08
• @spaceKnot I'm glad it was helpful however since "That is exactly what I was looking for" I'm curious why it's remained unaccepted. Commented Jun 30, 2017 at 15:27
• @Artes Sorry missed it. Commented Jul 2, 2017 at 0:23