I am trying to calculate $5^{144}\pmod{315}$.
I started by calculating φ(315) = φ(9) × φ(7) × φ(5) = 144, but I don't know how to continue from here.
I think I am stuck because $\gcd(5,315)=5$ and not $$, e.g. if I needed to find $4^{144}$ I'd say that since $φ = 144$ and $\gcd(4,315)=1$ we can deduce that $4^{144}=1\pmod{315}$ I suppose it should have something to do with φ being equal to the exponent, but I'm honestly not sure. If φ wasn't equal to the exponent would I be able to use the same method?
Thanks in advance!