[Math] Dimension of subspace of all upper triangular matrices

linear algebramatrices

If $S$ is the subspace of $M_7(R)$ consisting of all upper triangular matrices, then $dim(S)$ = ?

So if I have an upper triangular matrix
$$
\begin{bmatrix}
a_{11} & a_{12} & . & . & a_{17}\\
. & a_{22} & . & . & a_{27}\\
. & . & . & . & .\\
0 & . & . & . & a_{77}\\
\end{bmatrix}
$$

It looks to me that this matrix can potentially have 7 pivots, therefore it is linearly independent and so it will take all 7 column vectors to span it. But that answer is marked as incorrect when I enter it so what am I missing here?

Best Answer

I guess the answer is 1+2+3+...+7=28. Because every element in matrices in S can be a base in that space.