$\textsf{Let:}$
$$ S=\left[\begin{array}{rrrrrr}
0& 1& 0& 0&0\\ 0& 0& 1& 0&0\\ 0& 0& 0&1&0\\0&0&0&0&0
\end{array}\right]$$
$Compute \, S^k k=2,...,6$
$\text{ok we are supposed to do this with SAGE}$
$\text{but not sure how $S^k$ is applied}$
$\textsf{Let:}$
$$ S=\left[\begin{array}{rrrrrr}
0& 1& 0& 0&0\\ 0& 0& 1& 0&0\\ 0& 0& 0&1&0\\0&0&0&0&0
\end{array}\right]$$
$Compute \, S^k k=2,...,6$
$\text{ok we are supposed to do this with SAGE}$
$\text{but not sure how $S^k$ is applied}$
What does that mean? I do not recognize your notation. I am guessing here, but are you suggesting that you remove columns 1 and 5 and row 4? You cannot remove them because they are in the matrix. You would have a different matrix if you removed them. And, if you remove two columns and one row, you would still not have a square matrix.
Whatever rules you are using to determine what you can and cannot do with matrices are not rules of linear algebra. People on this forum keep telling you that we are not familiar with SAGE. I would recommend moving this question to a discussion board that is specific to SAGE. Because what you are suggesting is not a differential equations problem.
now that you have a square matrix as far as I can tell the entire exercise is to write a simple loop that repeatedly multiples this matrix by itself and prints the answer.
A quick gloss over the SAGE doc shows that this is pretty trivial to do.
What exactly do you need help with?