Find the delay and period of .

How I started:

.

Hence the delay .

I've run into a bit of a problem when I try and find the delay.

I need to find n s.t .

Comparing this to Euler's theorem .

My mark scheme also agrees with this result. However, can it always be done in this way? ie. will the delay always be reduced to where p is prime?