Is there a formula for the product of 3 matrices? That is, if $A\in {\mathbb{R}}^{m\times n},B\in {\mathbb{R}}^{n\times n},$, and $C\in {\mathbb{R}}^{n\times p}$, and I want the (i,j) entry of the product D=ABC, how can I write ${D}_{i,j}$? I know $(AB{)}_{i,j}=\sum _{k=1}^{n}{a}_{ik}{b}_{kj}$, but I'm not sure if this can be generalized to more than 2 matrices.