Sum of all elements : $(I+A+A^2)^{-1}$ Given matrix $A$ :
$$A=\begin{pmatrix}0&-1&1&-1\\0&0&-1&1\\0&0&0&1\\0&0&0&0\end{pmatrix}$$
Compute sum of all elements of $(I+A+A^2)^{-1}$.

At first, I tried to show $A^3=O$. Because If $A^3=O$, then $I-A^3=I$.
This implies $(I-A)(I+A+A^2)=I$. So Inverse of $I+A+A^2$
is $I-A$.
But $A^3\neq O$, So I can't apply following strategy.
I computed $I+A+A^2$ and found its inverse. But this method is too messy.
So main question is : Is there any method to solve this problem faster than computing $(I+A+A^2)^{-1} $ manually?
 A: The idea in my comment, fleshed out a bit.
First, without appealing to power series, since that may be uncomfortable:
As noted in the question, $I - A$ is not the inverse of $I + A + A^2$ since
$$ (I - A)(I + A + A^2) = I + A + A^2 - A - A^2 - A^3 = I - A^3. $$
So to arrive at an inverse we need to modify $I - A$ in such a way that the multiplication produces an $A^3$ to compensate.
Of course it's not possible to just produce an $A^3$; if we add anything to $I - A$ we will get several extra terms, but here we leverage the nilpotency of $A$.
Since $A^n = 0$ for all $n \geq 4$, so long as we arrange it so that all the "extra" terms produced are large powers of $A$, no harm done.
The "easiest" way you might try to make an $A^3$ appear in the multiplication above is to simply add an $A^3$ to $I - A$:
$$
\begin{align*}
(I - A + A^3) (I + A + A^2) &= I + A + A^2 - A - A^2 - A^3 + A^3 + A^4 + A^5 \\
&= I + A^4 + A^5 \\
&= I
\end{align*}
$$
since $A^4 = A^5 = 0$.
Therefore $(I + A + A^2)^{-1} = I - A + A^3$.

The comment about power series is really just a way to make this approach less ad hoc: By your favourite method of computing power series (Maclaurin series, Taylor series, whatever your favourite name), we have that
$$
\frac{1}{1 + x + x^2} = 1 - x + x^3 - x^4 + x^6 + \text{and so on}
$$
when expanded at $x = 0$.
In other words, the inverse of things of the shape $1 + x + x^2$ is of the shape $1 - x + x^3 + \text{bigger powers of $x$}$. But the thing we're working with vanishes when the powers get large, so ours is really a finite sum.
I bring this up mostly because it's a useful trick in general, thinking about (formal) power series for things (especially reciprocals) and then applying them to the particular objects you're working with.
The attempt (in the hopes that $A^3 = 0$) is really the same thing: since
$$
\frac{1}{1 - x} = 1 + x + x^2 + x^3 + \text{and so on}, 
$$
(that's a geometric series! Very good thing to be on the lookout for), if $x^n = 0$ for $n \geq 3$ then $(1 - x)(1 + x + x^2) = 1$. Of course some care should be taken when interpreting the formal result in, say, the context of matrices, so it is good to double check the calculations in the same way we did above with $(I - A + A^3)(I + A + A^2)$.
