# Fermat's/Euler problem

pacdude9
I've got a pair of (related) problems that are keeping me stumped. The two problems they are asking me to prove are:

$$p^{(q-1)} + q^{(p - 1)} \equiv 1 \; (\!\!\!\!\!\! \mod \, pq)$$

$$a^{\phi(b)} + b^{\phi(a)} \equiv 1 \; (\!\!\!\!\!\! \mod \, ab)$$

Where $$\phi(n)$$ is Euler's Totient Function.

I know that these are similar, as the second problem is using Euler's Theorem, a generalization of Fermat's Little Theorem, I just can't seem to figure them out.

$$q^p=q$$mod $$p$$. We can cancel q from both sides since gcd(q,p) = 1, so $$q^{(p-1)} = 1 (mod p)$$. Also $$p^{(q-1)} = 0 (mod p)$$ we get
$$p^{(q-1)} + q^{(p-1)} = 1 (mod p)$$