how to find inverse of a matrix in $\Bbb Z_5$ how to find inverse of a matrix in $\Bbb Z_5$
please help me explicitly how to find the inverse of matrix below, what I was thinking that to find inverses separately of the each term in $\Bbb Z_5$ and then form the matrix?
$$\begin{pmatrix}1&2&0\\0&2&4\\0&0&3\end{pmatrix}$$
Thank you.

Hint: Use the adjugate matrix.
Answer: The cofactor matrix of $A$ comes
$\color{grey}{C_A=
\begin{pmatrix}
+\begin{vmatrix} 2 & 4 \\ 0 & 3 \end{vmatrix} & -\begin{vmatrix} 0 & 4 \\ 0 & 3 \end{vmatrix} & +\begin{vmatrix} 0 & 2 \\ 0 & 0 \end{vmatrix} \\ 
-\begin{vmatrix} 2 & 0 \\ 0 & 3 \end{vmatrix} & +\begin{vmatrix} 1 & 0 \\ 0 & 3 \end{vmatrix} & -\begin{vmatrix} 1 & 2 \\ 0 & 0 \end{vmatrix} \\ 
+\begin{vmatrix} 2 & 0 \\ 2 & 4 \end{vmatrix} & -\begin{vmatrix} 1 & 0 \\ 0 & 4 \end{vmatrix} & +\begin{vmatrix} 1 & 2 \\ 0 & 2 \end{vmatrix}
\end{pmatrix}=
\begin{pmatrix}
6 & 0 & 0 \\ 
-6 & 3 & 0 \\ 
8 & -4 & 2
\end{pmatrix}=}
\begin{pmatrix}
1 & 0 & 0 \\ 
-1 & 3 & 0 \\ 
3 & 1 & 2
\end{pmatrix}.$
Therefore the adjugate matrix of $A$ is
$\color{grey}{\text{adj}(A)=C_A^T=
\begin{pmatrix}
1 & 0 & 0 \\ 
-1 & 3 & 0 \\ 
3 & 1 & 2
\end{pmatrix}^T=}
\begin{pmatrix}
1 & -1 & 3 \\ 
0 & 3 & 1 \\ 
0 & 0 & 2
\end{pmatrix}$.
Since $\det{(A)}=1$, it follows that $A^{-1}=\text{adj}(A)=
\begin{pmatrix}
1 & -1 & 3 \\ 
0 & 3 & 1 \\ 
0 & 0 & 2
\end{pmatrix}$.
And we confirm this by multiplying them matrices:
$\begin{pmatrix} 1 & -1 & 3 \\ 0 & 3 & 1 \\ 0 & 0 & 2\end{pmatrix}
\begin{pmatrix} 1 & 2 & 0 \\ 0 & 2 & 4 \\ 0 & 0 & 3\end{pmatrix}=
\begin{pmatrix} 1 & 0 & 5 \\ 0 & 6 & 15 \\ 0 & 0 & 6\end{pmatrix}=
\begin{pmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1\end{pmatrix}$.
