I wonder about an equation given as a solution to the following task:
Calculate the multiplicative inverse $$5^{−1} \pmod {13}$$
The solution ends in this equation: $$ 5^{11} \equiv 5^{10} \cdot 5 \equiv −1\cdot 5 \equiv 8 \pmod {13} $$ and the check:
$$ 5 \cdot 8 \equiv 40 \equiv 1 \pmod{13} $$
1) What is the inverse here now?
2) Why is $5^{10} \equiv -1 \pmod {13}$?
As far as I understood Fermat the rule is given as: $$ x^{(p−1)} \equiv 1 \pmod p $$ which won't come into account here, since in this case $p = 13$ and not ideal for calculating $5^{11}$.
If I would use $x^{p−1}$ it would be $5^{12}$ in this case, so I'd still need to divide by $5^1$ to get to the result of $5^{11}$.
I am so confused although it should be really easy.