In regards to the simplification problem (5^596 mod 599): I know the answer is 24, and I also know I can simplify 5^596 to:

5^596

= 5^(598-2)

= 5^598 * 5^-2

The problem (5^598 * 5^-2) mod 599 becomes (1* 5^-2) mod 599. But this simplified problem does not equal 24. Does anyone know what I'm doing wrong?