11 questions linked to/from calculating $a^b \!\mod c$
18k views

### Modular exponentiation by hand ($a^b\bmod c$)

How do I efficiently compute $a^b\bmod c$: When $b$ is huge, for instance $5^{844325}\bmod 21$? When $b$ is less than $c$ but it would still be a lot of work to multiply $a$ by itself $b$ times, for ...
53 views

### Calculate $7^{154} \pmod{341}$ [duplicate]

how to calculate remainder of $7^ {154}$ when it is divided by $341$. Could you please state which method or theorem to use.