Originally Posted by Ackbeet
I'm not sure I buy the theorem, unless $p$ is a prime. Is that a convention in number theory? If so, I would probably write out the prime factorization of $a$ and go from there.
Yes, $p$ usually stands for a prime number in elementary number theory.