First known appearance in a work of Ibn al-Haytham (965-1039). Stated by Leibniz in an unpublished paper around 1670. Conjectured by John Wilson before 1770. First proved by Lagrange in 1771.
i.e. if is prime, divides into
i.e. divides . But then divides or , by the prime divisor property, so
In 1957, F.G. Elston generalized Wilson’s theorem:
Let be prime and .