I have a kind of confusion dealing with modular arithmetic, specially regarding remainders. I am aware of Euler/Fermat theorem that says: if p is prime, then 2^(p-1) is congruent to 1 module p.
However, supose that p is not prime. How is the best approach to compute a remainder?. For example: how to compute a remainder of 3^2348 by 25?
Thanks...