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.