0

I don't know if there is any theorem that we can use to break the 'mod 125' in modulo of smaller integers to make computation simpler/easier/faster. Or we will just have to find the inverse of 27 modulo 125 by brute force?

I am self-learning the number theory so I don't know if it is a dumb question. Yet, I could not find any piece of information about it online. Any hints about it would be nice. Thank you.

Anson NG
  • 965
  • 3
    You can use Euler's theorem (generalization of Fermat's little theorem) to ease the computation, but because 125 is a prime power, you can't use something like the Chinese remainder theorem to break the problem into smaller problem. Thee problem shouldn't involve finding the inverse of 27, but that is easily doable by using the extended Euclidean algorithm, which is significantly faster than brute force, especially for a computer. – Aaron Oct 02 '21 at 04:59
  • Thank you very much. That really helps! – Anson NG Oct 02 '21 at 05:13
  • 1
    A very similar question has been posted here: https://math.stackexchange.com/questions/4261409/computing-55555-mod-100000-105 –  Oct 02 '21 at 06:53

0 Answers0