# Evaluating the product of a matrix sequence [duplicate]

I want to compute $$\prod_{i=1}^n A_i = A_1 A_2 \cdots A_n$$ where every $A_i$ is a square matrix. When I execute

a[i_] := {{1, i}, {0, 1}};
Product[a[i], {i, 1, 10}]


Mathematica gives the element-wise product, which is not what I need. The desired result can be obtained by

Fold[Dot, IdentityMatrix[2], Table[a[i], {i, 1, 10}]]


but I'm curious if there's a simpler solution.

Dot @@ (a /@ Range@10)

Dot @@ Array[a, 10]

• Didn't know that Dot accepts more than 2 arguments – uranix Aug 7 '15 at 17:13