How would I evaluate this?
19 ^ 99 mod 160
The usual method using Euler's Theorem doesn't seem to help.
Is there another strategy I should learn about?
How would I evaluate this?
19 ^ 99 mod 160
The usual method using Euler's Theorem doesn't seem to help.
Is there another strategy I should learn about?
@kbm0 @rzeta0 Also, IIRC, you can use the https://en.wikipedia.org/wiki/Chinese_remainder_theorem to keep the numbers slightly smaller my calculating modulo 32 and 5 and then reconstructing.
You'd get that 19^99 is 4 mod 5 and 19^99 is 11 mod 32, and apply one of the computation techniques from the linked article.
here is my ugly write-up of that particular exercise
https://numbertheorystepbystep.blogspot.com/2026/04/exercise-5219.html
(I've been trying to write up every exercise in the book I'm working through, it helps me learn it all better)