According to Wilson's theorem, what factorial must be divisible by n if some integer n > 4 is to be considered composite?
The fraction 1/p expressed likewise in base q (rather than base 10) has similar effect, provided that p is not a prime factor of q. Wilson's theorem says that an integer p > 1 is prime if and only if the factorial (p − 1)! + 1 is divisible by p.