# Question regarding Wilson's Theorem

Let $p$ be prime, and $a$ be integer. When does $(p - 1)! + 1 = p^a$ for some $a$ hold?

For example: $$p = 5 \implies (5 - 1)! + 1 = 25 = 5^2$$ $$p = 7 \implies (7 - 1)! + 1 = 721 = 7 \cdot 103$$

Any idea?

Thanks,

-
Apparently $13^2|\ ((13-1)!+1)$ as well. – Eric Naslund Mar 13 '11 at 5:52

A Wilson prime is a prime number $p$ such that $p^2$ divides $(p-1)!+1$. The only known Wilson primes are 5, 13, and 563.