Sort:  

Consider.

gcd(N, p) = 1 ⇒ NΦ(p) mod p = 1 by Euler's theorem

gcd(N, p) ≠ 1, N = pb ∙ a, pb ≡ 0 mod p ⇒ NΦ(p) mod p = 0

Hope this helps