<s>[INST] Inverse of a modular matrix I have the matrix$$
\begin{pmatrix}
1 & 5\\
3 & 4
\end{pmatrix} \pmod{26}
$$
and I need to find its inverse. I do it according to this website.
I find the modular multiplicative inverse (of the matrix determinant, which is $1×4-3×5=-11$) with the extended Euclid algorithm (it is $-7 \equiv  19 \pmod{26}$). Then I have $$\frac{1}{19}×\begin{pmatrix}4 & -5\\-3 & 1\end{pmatrix}.$$ I calculate that$$-5 \equiv 21 \pmod{26},\ -3 \equiv 23 \pmod{26}.$$
No matter what I do I am not able to get the solution they have on the website, which is$$\begin{pmatrix}2 & 17\\5 & 7\end{pmatrix}.$$
Can someone help me with this? What am I doing wrong?
 [/INST] Doing aritmetic modulo $\;26\;$ all the time, we get that
$$\det A=\begin{vmatrix}1&5\\3&4\end{vmatrix}=4-15=-11=15\implies$$
$$\implies A^{-1}=\frac1{15}\begin{pmatrix}4&-5\\-3&1\end{pmatrix}=7\begin{pmatrix}4&21\\23&1\end{pmatrix}=\begin{pmatrix}2&17\\5&7\end{pmatrix}$$
</s>