P = x y,

then P^(z+1) = P^(x+y) mod P.

Proof:

The number of positive integers < P that are

relatively prime to P is (x-1)(y-1).

By fundamental group theory theorem,

for any relatively prime integer b, to P,

b^( (x-1)(y-1)) = 1 mod P.

b^(x y - y - x + 1) = 1 mod P.

b^(x y + 1 - (x+y) ) = 1 mod p

b^(x y + 1) = b^(x+y) mod P

b^(P + 1) = b^(x+y) mod P.

Kermit