Originally Posted by
andreas $\displaystyle 251^{1001}=(251^{100})^{10}251^1$ but according Fermat's theorem $\displaystyle 251^{100}$ in $\displaystyle Z_{101}$ is $\displaystyle 1^{100}$ so you have that $\displaystyle 251^{1001}$ in $\displaystyle Z_{101}$ is $\displaystyle 251\bmod 101 =49$