We have , where is the Carmichael function. So we have
The powers of 5 modulo 6 follow a periodic pattern
and so on, with odd powers of 5 equivalent to 5 modulo 6. So
The rest is easy to deal with. We have
and so the answer is 19.
9.5m questions
12.2m answers