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?
I have to think about this - it seems like a simple method.
Why didn't I think of it? Is it because my brain has become stuck in the methods taught by the textbook I'm following and not seeing beyond those.
@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.
Search starting from 19^99 = 11 mod 32
11 /= 4 mod 5
43 /= 4 mod 5
75 /= 4 mod 5
107 /= 4 mod 5
139 = 4 mod 5
-> 19^99 = 139 mod 160
thank you - the textbook author's official solution uses the Chinese remainder theorem but it has always been something my brain didn't like
this is a good opportunity to revisit it
thanks again for your help
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)