Generalized Method to find nth power of matrix in $P^n = 5I - 8P$ 
Question: Let $I$ be an identity matrix of order $2 \times 2$ and $P = \begin{bmatrix}
    2 & -1 \\
    5 & -3 \\
   \end{bmatrix}$. Then the value of $n ∈ N$ for which $P^n = 5I - 8P$ is equal to _______.
Answer: 6
Question Source: JEE Mains $18^{th}$ March Shift-2 2021

By characteristic Equation: $P^2-(\operatorname {Tr}(P))P+(\det (P))I=0$ we can find $n=6$ by hit and trial. i.e. multiplying equation by P gives
$P^3=(\operatorname {Tr}(P))P^2-(\det (P))P = (\operatorname {Tr}(P))[(\operatorname {Tr}(P))P+(\det(P))I]$
And going on solving for $P^6$. But is there a generalized method because it can't be done for high values of $n$ (eg:$100$)?
 A: Hint: Write $P^n= a_n P + b_n I$. Then $P^2=-P+I$ implies $a_{n+1}=-a_n+b_n$ and $b_{n+1}=a_n$. Thus, $a_{n+1}=-a_n+a_{n-1}$ with $a_0=0$ and $a_1=1$. Trying the first few $n$ suggests that $a_n=(-1)^{n+1} F_n$, where $F_n$ is the $n$th Fibonacci number. Prove it by induction and find $n$ such that $a_n=-8$.
A: As Moo implied in a comment, if the required value of $\ n\ $ were very large, it would be a very unfair question for you to be expected to answer in an exam in which you only have $2$ minutes $10$ seconds to do so. Here, however, is a reasonably efficient method for obtaining the value of $\ n\  $ (if it exists) for which $\ P^n=aP+b\ $.
You've found that $\ P\ $ satisfies the equation
$$
P^2=-P+I\ ,
$$
which means that
$$
P^n=c_nP+c_{n-1}I\ ,
$$
where $\ c_n\ $ is the $\ n^\text{th}\ $  term in the sequence satisfying the recurrence
\begin{align}
&c_{n+1}=-c_n+c_{n-1}\\
&c_1=1,\ c_2=-1\ .
\end{align}
The equation
$$
P^n=aP+bI
$$
can be solved for (positive) $\ n\ $ if and only if $\ b\ $ and $\ a\ $ are successive terms in this sequence. To find the value of $\ n\ $
for which $\ a=c_n\ $ and $\ b=c_{n-1}\ $ you can use the identity
$$
c_n=\frac{\alpha^n-\beta^n}{\sqrt{5}}\ , 
$$
where $\ \alpha=\frac{\sqrt{5}-1}{2}\ $ and $\ \beta=-1-\alpha\ $. Thus, if $\ a=c_n\ $ and $\ b=c_{n-1}\ $, then
$$
a-\beta b=\frac{(\alpha-\beta)\alpha^{n-1}}{\sqrt{5}}=\alpha^{n-1}\  
$$
or
$$
n=\frac{\log(a-\beta b)}{\log\alpha}+1\ .
$$
This will only be a solution if it is an integer, and $\ a=c_n\ $, but once you've found the putative value of $\ n\ $ it's easy to check whether $\ a=c_n\ $ and $\ b=c_{n-1}\ $, or that $\ P^n=aP+b\ $ directly.
For the specific problem you've given
$$
n=\frac{\log(-8-5\beta)}{\log\alpha}+1=6\ .
$$
Addendum:
As lhf pointed out in his answer, $\ c_n=(-1)^{n+1}F_n\ $, where $\ F_n\ $ is the $\ n^\text{th}\ $ Fibonacci number (my $\ c_n $ is lhf's $\ a_n\ $), a point which I missed, and which may help you follow the above exposition more easily.  My formula for $\ c_n\ $ above is just a transformed version of the corresponding one for Fibonacci numbers:
$$
F_n=\frac{\phi^n-\psi^n}{\sqrt{5}}\ ,
$$
where $\ \phi=-\beta\ $ and $\ \psi=-\alpha\ $.
A: We can diagonalize the matrix $P$ because it has unique eigenvalues.
One of the benefits of this is in finding matrix powers.
For your example, we have eigenvalues as
$$\lambda_{1,2} = \frac{1}{2} \left(\mp\sqrt{5}-1\right)$$
The eigenvectors are
$$v_{1,2} = \begin{pmatrix} \dfrac{1}{10} \left(5\mp\sqrt{5}\right) \\ 1\end{pmatrix}$$
We can now write $P = V D V^{-1}$ as
$$\begin{pmatrix}
 \dfrac{1}{10} \left(5-\sqrt{5}\right) & 1 \\
 \dfrac{1}{10} \left(\sqrt{5}+5\right) & 1 \\
\end{pmatrix} \begin{pmatrix}
 \dfrac{1}{2} \left(-\sqrt{5}-1\right) & 0\\ 0 & \dfrac{1}{2} \left(\sqrt{5}-1\right)
\end{pmatrix}\begin{pmatrix}
 \dfrac{1}{2} \left(1-\sqrt{5}\right) & 0 \\
 0 & \dfrac{1}{2} \left(\sqrt{5}+1\right) \\
\end{pmatrix}$$
Now $P^n = V D^n V^{-1}$ is
$$\begin{pmatrix}
 \dfrac{1}{10} \left(5-\sqrt{5}\right) & 1 \\
 \dfrac{1}{10} \left(\sqrt{5}+5\right) & 1 \\
\end{pmatrix} \begin{pmatrix}
 \left(\dfrac{1}{2} \left(-\sqrt{5}-1\right)\right)^n & 0\\ 0 & \left(\dfrac{1}{2} \left(\sqrt{5}-1\right)\right)^n
\end{pmatrix}\begin{pmatrix}
 \dfrac{1}{2} \left(1-\sqrt{5}\right) & 0 \\
 0 & \dfrac{1}{2} \left(\sqrt{5}+1\right) \\
\end{pmatrix}$$
A: Here is a standard method which can be used both for calculating a high power of a $2 \times 2$ matrix and solving this problem. It can be extended to higher size matrix.
Let $X^2+aX+b$ be the characteristic polynomial. Then there exists some $a_n,b_n$ such that
$$
X^n=Q(X)(X^2+aX+b)+ a_nX+b_n \,...(1)
$$
$a_n,b_n$ can be calculated explicitely, by plugging in the equation the two roots $r_1,r_2$ of the characteristic polynomial.
Plugging $A$ in (1) you get
$$
A^n=a_nA+b_n \,.
$$
In case of a double root differentiate (1) with respect to $X$ gives ($\alpha$ is repeated eigenvalue)
$$nX^n=2Q(X)(X-\alpha) + Q'(X)(X-\alpha)^2 + a_n \,...(2)$$ put eigenvalue in (1) and (2)
In your particular problem $r_{1,2}=\frac{-1\pm \sqrt{5}}{2}$ and hence
$$
(\frac{-1\pm \sqrt{5}}{2})^n=a_n\frac{-1\pm \sqrt{5}}{2}+b_n 
$$
You need to figure out $n$ such that
$$
(\frac{-1\pm \sqrt{5}}{2})^n=-8\frac{-1\pm \sqrt{5}}{2}+5 
$$
A: A comment before the answer:
I was confused at this question but when I saw your quadratic equation, suddenly the method struck my mind. It was under all our noses, but we were too much attached to using the standard tools like eigen values and eigen vectors.

Soltn:
Mentally, one may calculate the trace as $-1$ and determinant as $-1$: This gives us the following equation:
$$P^2 + P =I \tag{1}$$
Since $ det P \neq 0 $ it is invertible, now go to problem in question $$P^n +8P = 5I$$
Now, plug in the identity matrix in terms of $P$ and simplfy:
$$P^n + 3P = 5P^2$$
We can multiply both side by $P^{-1}$:
$$P^{n-1} +3I = 5P$$
Repeating, the procedure :
$$ P^{n-2} + 3 P^1 = 2I$$
Let's hit it with the bat one more time:
$$ P^{n-3} +I= 2(P^1 )$$
And again:
$$ P^{n-4} +P  = I$$
There is a famous quote "No need to beat a dead horse" but this equation we have to substitute once more:
$$P^{n-4}  = P^2 $$
Hence, $n-4=2$ or $n=6$
For higher powers, there maybe a way to short this process of back substitution. I'll leave that to you to figure out.
A: I wanted to give an extension to the answer from N.S., who reduced the problem to finding $n$ such that
$$\left(\frac{-1\pm \sqrt{5}}{2}\right)^n=-8\frac{-1\pm \sqrt{5}}{2}+5$$
This is actually two equations which are conjugate to each other, and if we add or multiply them together, the irrationalities disappear.
Multiplication would normally be the easier method, but unfortunately, in this case, calling the $\phi=\frac{-1+ \sqrt{5}}{2}$ and $\overline{\phi}=\frac{-1 - \sqrt{5}}{2}$, the fact that $\phi \overline{\phi}=-1$ and $\phi+\overline{\phi}=-1$ means that the equation simplifies to
$$(-1)^n=1$$
which only tells us that $n$ must be even, although if we had a different problem where $\det(P)\neq \pm 1$, this would have let us easily solve the problem.  We can get more information by adding the two equations, in which case
$$\phi^n+\overline{\phi^n}=18.$$
N.B. We remark that taking the product or sum of the two equations is what falls out if we diagonalize the original matrix, then take the determinant and trace.
However, how do we deal with the left hand side of the equation? We can use the fact that $\phi$ and $\overline{\phi}$ both satisfy the equation $x^2=-x+1$, which will imply that $\phi^n$ and $\overline{\phi^n}$ (and hence their sum) both satisfy the linear recurrence relation $a_{n+1}=-a_{n}+a_{n-1}$, and their sum has the initial conditions that $a_0=2$, $a_1=-1$.  This can be computed for small values of $n$ (and will be, up to a sign, the Lucas numbers), but this is prohibitively difficult for large values of $n$.
We can get an estimate, however, by using the fact that $0<\phi^2<1$ and $2<\overline{\phi^2}<3$.  Because $3^2<17$, we know that $n>4$, and because $2^5>18$, we know that $n<10$.  This means (since we know $n$ is even), that $n=6$ or $8$. Of course, if you have a calculator, none of this additional work is necessary, as one can simply solve the problem with logs.
