WordGPT

Wilson's theorem

A number p is prime exactly when (p − 1)! + 1 is divisible by p. History: stated 1770, proved by Lagrange.

How to work it out

  1. 1

    The statement:

    (p−1)!≡−1(modp)  ⟺  p is prime(p-1)! \equiv -1 \pmod p \iff p \text{ is prime}
  2. 2

    A number p is prime exactly when (p − 1)! + 1 is divisible by p.

  3. 3

    Below, the numbers in the table are computed by this site from the definition, not copied.

LaTeX source of the formulas on this page
\[ (p-1)! \equiv -1 \pmod p \iff p \text{ is prime} \]

Checking n = 2 to 12 (computed)

n(n−1)! mod nPrime?
21yes (−1)
32yes (−1)
42no
54yes (−1)
60no
76yes (−1)
80no
90no
100no
1110yes (−1)
120no

Questions

What is the wilson's theorem?

A number p is prime exactly when (p − 1)! + 1 is divisible by p.

Who is the Wilson's theorem associated with?

Joseph-Louis Lagrange.

People

More theorems

    Wilson's theorem: statement, example and proof idea | WordGPT