Solution (source code)

= Solution

<Matrix addition> requires equal shapes. The shapes $3\times n$ and $n\times3$ agree exactly when $\boxed{n=3}$.