Link to the problem/solution: https://artofproblemsolving.com/wiki/index.php/2010_AMC_10A_Problems/Problem_24
I'm trying to understand the following step in the solution to the aforementioned AMC problem.
Given:
- $M = \cfrac{90!}{5^{21}}$
- $N = \cfrac{90!}{10^{21}} = \cfrac{M}{2^{21}}$
- $M \equiv 24 \bmod 25$
- $2^{21} \equiv 2 \bmod 25$
Then:
$N \bmod 25 = \cfrac{24}{2} = 12$
In the above approach, we write N as a fraction, find the modulo-25 residue of the numerator and denominator, and divide the residues to find the modulo-25 residue of N.
I recently finished working through the Art of Problem Solving textbook "Introduction to Number Theory", so I'm familiar with the basics of solving modular congruence equations and modular arithmetic, but I was confused by this step. I was wondering: under what conditions can we divide modular congruent statements, and why does this step work? My understanding was that addition, multiplication, and exponentiation work with modular congruent statements, but I never saw an example in the book of dividing statements as in the above case.
For instance:
$98 \equiv 23 \bmod 25$
$49 \equiv 24 \bmod 25$
$2 \equiv ? \bmod 25$
In this example, I don't think division produces a meaningful result (perhaps it does, but I don't know how to evaluate 23/24?). Why does division fail here, but work above? (EDIT: -2 / -1 = 2, so I guess it works in this case too!)
My suspicion is that I'm missing something really basic here, perhaps even misinterpreting what the solution is doing. If you have any book recommendations that would help me improve and solidify my understanding of modular arithmetic/modular congruence, I'd greatly appreciate it!