I have a problem where I need to guess $425^{17} \pmod{541}$
$p=541$ is prime so, applying Fermat's little Theorem $a^{p-1} \equiv 1 \pmod{p}$ we got
$425^{540} \equiv 1 \pmod{541}$
But how should I continue?
I am trying $\frac{17}{540}= 0*540 + 17$ but nothing to do with this...
If you insist on doing it by hand, use repeated squaring (via a calculator for squaring and "remaindering" by $541$):
Which Python will immediately compute (essentially via this same algorithm ) by
pow(425,17,451), which is a bit easier.