Is there any fast way to get the remainders of the division of large numbers?
Like$-$
$$\frac{77^{200}}{54}$$
Is there any fast way to get the remainders of the division of large numbers?
Like$-$
$$\frac{77^{200}}{54}$$
As $77\equiv23\pmod{54}, 77^n\equiv23^n$
As Carmichael Function $\lambda(54)=18$
and as $(77,54)=1$
and as $200\equiv2\pmod{18}$
$$23^{200}\equiv23^2{\pmod{54}}\equiv-11\equiv-11+54$$