0

Let's say we have the expression $a^b \mkern-10mu\mod\! c$ and $b$ is really large, e.g. $37^{165}\mkern-10mu\mod 65$.

How to work this out by hand?

There's a way to avoid the large exponent.

Sebastiano
  • 7,649
Lucien
  • 115
  • 2
    https://en.wikipedia.org/wiki/Exponentiation_by_squaring – Angina Seng Dec 11 '19 at 20:53
  • 2
    For many worked examples see the "Linked" questions in the above-linked duplicates. – Bill Dubuque Dec 11 '19 at 21:15
  • $37^{165} \equiv(37^{48})^337^{21}\equiv(-28)^{21}\equiv-2^{42}7^{21}\equiv-2^{42}(7^4)^57\equiv-2^{42}(-4)^57\equiv2^{52}7\equiv2^{48}2^47$ $\equiv16\times7\equiv47\bmod65$ since $\gcd(n,65)=1\implies n^{48}\equiv1\bmod65$ by Euler's theorem and $7^4\equiv-4\bmod65$ – J. W. Tanner Dec 11 '19 at 23:13
  • You can use a weighted sum of quotient and remainder of the exponent but it's no quicker than Eulers totient theorem in most cases, and doesn't generalize well. –  Dec 12 '19 at 00:42
  • Here's my work: $$37^{48}\equiv 1\bmod 65\implies 37^{65}\equiv 37^{17}\bmod 65$$$$\implies 37^{165}\equiv (37^{17})^237^{35}\equiv 37^{69}\bmod 65$$$$\equiv 37^{17}37^4\equiv 37^{21}\bmod 65$$ –  Dec 12 '19 at 15:39

0 Answers0