I am trying to calculate $${34}^{429} \mod 431$$ by hand. (This follows from $34^{-1}\mod 431$).
I think I have made mistakes in my working, and have three different answers thus far from the attempts:
$$351, 306, 134$$
Is one of these correct? If none of the above is correct please provide an answer with working.
You can use the extended Euclidean algorithm to find the inverse of $34\bmod 431$:
$\begin{array}{c|c} n & s & t & q \\ \hline 431 & 1 & 0 & \\ 34 & 0 & 1 & 12 \\ 23 & 1 & -12 & 1 \\ 11 & -1 & 13 & 2 \\ 1 & 3 & -38 & 11 \\ \end{array}$
... with each line expressing $n=431s+34t$ by suitable combination of the previous two lines.
The final line gives $3\cdot 431 + (-38)\cdot 34 = 1$, so $(-38)\cdot 34\equiv 1 \bmod 431$ and thus $34^{-1}\equiv -38\equiv 393 \bmod 431$