Let $A= \begin{bmatrix} 1& -1 & 1\\ 0 & 1 & 1 \\ 0 & 0 & 1\\ \end{bmatrix}$. Compute $A^k$.
My attempt
I'm trying to compute $A^k$ using this approach as follows: $$ A=I+N= \begin{bmatrix} 1& 0 & 0\\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{bmatrix}+ \begin{bmatrix} 0& -1 & 1\\ 0 & 0 & 1 \\ 0 & 0 & 0\\ \end{bmatrix} $$ with $$ N^2= \begin{bmatrix} 0& 0 & -1\\ 0 & 0 & 0 \\ 0 & 0 & 0\\ \end{bmatrix}, \, \text{and} \, \, N^3= \begin{bmatrix} 0& 0 & 0\\ 0 & 0 & 0 \\ 0 & 0 & 0\\ \end{bmatrix} $$
Then, $$ A^2=(I+N)^2=I+2N+N^2, \\ A^3=(I+N)^3=I+3N+3N^2, \\ A^4=(I+N)^4=I+4N+6N^2, \\ A^5=(I+N)^5=I+5N+10N^2, \\ A^6=(I+N)^5=I+6N+15N^2, $$
By induction, we can see $A^k=(I+N)^k=I+kN+f[k]N^2$. But, I couldn't figure out what $f[k]$ is. Any help?
How about this. Take the exponential function $e^{tA}$, where $t$ is some parameter $$e^{tA}=\sum_{k=0}^\infty\frac{t^kA^k}{k!}=e^{t(I+N)}= e^{tI}e^{tN}=e^t\left[I+tN+\frac{(tN)^2}{2}\right]$$ where we used the matrix identity $e^{A+B}=e^Ae^B$ that is valid when matrices $A$ and $B$ commute. Since the functions $t^k$ are linearly independent, we obtain $$A^k=I+kN+\frac{k(k-1)}{2}N^2$$