Shortcut to find the cube and square of a square matrix?

I found myself doing the same task repetitively so I was wondering if there is a short formula or generalized equation that can give me the square or cube of a matrix ($A\cdot A$ or $A\cdot A \cdot A$) without having to multiply it by itself again and again. Could not find anything on the internet related to this.


The Cayley-Hamilton Theorem can be useful. It states that every matrix obeys its own characteristic polynomial. Finding the polynomial is not trivial, but once you have it you have a quicker way to find higher powers. The advantage is that you only have to multiply by a constant and add.