I am new to modular arithmetic. I have gone through a few formulae related to this but I am unable to solve problems like (5^12) mod 23. I am not really bothered about the final answer, but mainly on the approach on these kinds of problems (or maybe more involving complex powers). Any help is appreciated. Thank you.
Asked
Active
Viewed 25 times
0
-
1Please read the following: https://www.khanacademy.org/computing/computer-science/cryptography/modarithmetic/a/fast-modular-exponentiation – Noble Mushtak Dec 29 '18 at 00:57
-
Fermat's little theorem and Euler's totient function come to mind. – For the love of maths Dec 29 '18 at 00:58
1 Answers
2
- Rewriting "big" numbers like $920 \,\rm{mod}\, 1000$ as "smaller" numbers: $920 \equiv -80$.
- Finding patterns in exponents (for example, $2^n \,\rm{mod}\, 10$ has a cycle $2,\, 4,\, 8,\, 6$ with $4$ steps).
- Reducing big exponents using Euler's $\phi$.
- Squaring (!). For example, in $231^{19} \,\rm{mod}\,517$, you might find, first, $231^2$ and then use that $231^{19} = {(231^2)}^9\times 231$. Iterating this makes every congruence so, oh so much easier..
Those are the main techniques I'm aware of.

Lucas Henrique
- 2,513