Exercise 2.1.34 (Converse of Wilson's theorem.)

Show that an integer m > 1 is prime if and only if m divides ( m 1 ) ! + 1 .

Answers

Proof. The Wilson’s theorem (Theorem 2.11) shows that if m is prime, then m divides ( m 1 ) ! + 1 . To prove the converse, we show that if m > 1 is not prime (i.e m is composite), then m doesn’t divide ( m 1 ) ! + 1 .

Let m > 1 a composite number. Then m = ab , where 1 < a < m , 1 < b < m .

Suppose first that a b . Since a m 1 , b m 1 , then a , b are distinct elements of the set { 2 , , m 1 } , therefore m = ab divides ( m 1 ) ! (even if a , b are not relatively prime). Hence m ( m 1 ) ! + 1 (otherwise m 1 = ( ( m 1 ) ! + 1 ) ( m 1 ) ! ).

The only case where the composite m is not a product m = ab where 1 < a < b < m is the case where m = p 2 is the square of a prime number p . Indeed, write m = p 1 a 1 p k a k ( p 1 < < p k ) the decomposition of m in prime factors.

  • If k 2 , we can take a = p 1 a 1 , b = p 2 a 2 p k a k are distinct non trivial divisors of m .
  • If k = 1 , m = p k for p = p 1 . If k > 2 , then a = p , b = p k 1 are distinct non trivial divisors of m .

It remains to prove p 2 ( p 2 1 ) ! + 1 , if p is some prime number.

Assume for contradiction that p 2 ( p 2 1 ) ! + 1 . A fortiori p ( p 2 1 ) ! + 1 . But p p 2 1 ( because p ( p 1 ) 1 ), therefore p ( p 2 1 ) ! , thus p 1 , and this is impossible since p is prime.

We have proved that if m is composite, then m ( m 1 ) ! + 1 .

To conclude, m > 1 is prime if and only if m divides ( m 1 ) ! + 1

User profile picture
2024-07-31 10:20
Comments