Sign in to save

Bookmark this page so you can find it later.

Sign in to save

Bookmark this page so you can find it later.

Wilson's Theorem & Primality Reference cheat sheet - grade 11-12

Click image to open full size

Math Grade 11-12

Wilson's Theorem & Primality Reference Cheat Sheet

A printable reference covering Wilson's theorem, factorial congruences, modular inverses, primality tests, and composite number checks for grades 11-12.

Download PNG

Study as Flashcards

Wilson's Theorem gives a powerful connection between factorials and prime numbers. This cheat sheet helps students recognize when a number is prime using modular arithmetic and understand why factorial congruences matter in number theory. It is especially useful for contest math, proofs, and advanced algebra topics.

The reference focuses on formulas, conditions, and careful reasoning rather than long computations.

The central result is that an integer p>1p > 1 is prime exactly when (p1)!1(modp)(p - 1)! \equiv -1 \pmod{p}. Students also need modular inverses, congruence notation, and efficient ways to detect composites before applying a factorial test. Wilson's Theorem is elegant but not always computationally efficient for large numbers.

The most important skill is knowing when the theorem proves primality and when simpler divisibility tests should be used first.

Key Facts

  • Wilson's Theorem states that an integer p>1p > 1 is prime if and only if (p1)!1(modp)(p - 1)! \equiv -1 \pmod{p}.
  • The congruence (p1)!1(modp)(p - 1)! \equiv -1 \pmod{p} is equivalent to (p1)!p1(modp)(p - 1)! \equiv p - 1 \pmod{p}.
  • If n>1n > 1 and (n1)!≢1(modn)(n - 1)! \not\equiv -1 \pmod{n}, then nn is composite.
  • To test whether nn is prime by trial division, check divisibility only by primes qq with qnq \leq \sqrt{n}.
  • For a prime pp, every nonzero residue aa modulo pp has a modular inverse a1a^{-1} such that aa11(modp)a a^{-1} \equiv 1 \pmod{p}.
  • In the proof of Wilson's Theorem, most residues modulo a prime pair with their inverses, leaving only 11 and p1p - 1 because x21(modp)x^2 \equiv 1 \pmod{p} has solutions x±1(modp)x \equiv \pm 1 \pmod{p}.
  • For a prime pp, Wilson's Theorem can be rearranged as (p2)!1(modp)(p - 2)! \equiv 1 \pmod{p} because (p1)!=(p1)(p2)!(p - 1)! = (p - 1)(p - 2)!.
  • Wilson's Theorem is a true primality criterion, but computing (n1)!(modn)(n - 1)! \pmod{n} is usually inefficient for large nn.

Vocabulary

Prime number
A prime number is an integer greater than 11 whose only positive divisors are 11 and itself.
Composite number
A composite number is an integer greater than 11 that has at least one positive divisor other than 11 and itself.
Congruence
The statement ab(modn)a \equiv b \pmod{n} means that nn divides aba - b.
Factorial
The factorial n!n! is the product n!=n(n1)(n2)21n! = n(n - 1)(n - 2)\cdots 2 \cdot 1 for positive integers nn.
Modular inverse
A modular inverse of aa modulo nn is a number bb such that ab1(modn)ab \equiv 1 \pmod{n}.
Primality test
A primality test is a method used to decide whether a given integer is prime or composite.

Common Mistakes to Avoid

  • Using Wilson's Theorem on n=1n = 1 is wrong because the theorem requires an integer p>1p > 1 and primality is only defined for integers greater than 11.
  • Forgetting the negative residue is wrong because (p1)!1(modp)(p - 1)! \equiv -1 \pmod{p} means the same as (p1)!p1(modp)(p - 1)! \equiv p - 1 \pmod{p}, not 11.
  • Assuming Wilson's Theorem is fast for large numbers is wrong because calculating (n1)!(modn)(n - 1)! \pmod{n} can require many multiplications.
  • Checking divisibility past n\sqrt{n} is unnecessary because if n=abn = ab and both a>na > \sqrt{n} and b>nb > \sqrt{n}, then ab>nab > n.
  • Claiming that (n1)!1(modn)(n - 1)! \equiv -1 \pmod{n} only suggests primality is wrong because Wilson's Theorem gives an if and only if condition for n>1n > 1.

Practice Questions

  1. 1 Use Wilson's Theorem to verify that 55 is prime by computing 4!(mod5)4! \pmod{5}.
  2. 2 Determine whether 66 passes Wilson's Theorem by computing 5!(mod6)5! \pmod{6}.
  3. 3 For the prime p=11p = 11, find the value of 10!(mod11)10! \pmod{11} without multiplying all factors.
  4. 4 Explain why Wilson's Theorem is useful for proving facts about primes but is usually not the best practical method for testing very large numbers.