Remark

If p is not a prime, the statement need not hold.

For example, with n = 3 and p = 4, we have

np-1 = 33 = 3 mod 4.