Compare this with Wilson 's theorem , which states that every prime p divides ( p 1 ) ! denotes the factorial function ; compare this with Wilson 's theorem , which states that every prime p divides ( p 1 ) !