Here is Problem 51, parts *a *and *b*, in Chapter 6 of the classic text *Concrete Mathematics*:

51. Let *p* be a prime number.

*a*. Prove that , for .

*b*. Prove that , for .

In this post I will show that the converses of these hold. In other words,

*51a (converse)*. If , and for , then *p* is prime.

*51b (converse)*. If , and for , then *p* is prime.

**Theorem 1**: If , and for all , then *p* is prime.

**Proof**: We know from basic properties of Stirling numbers that and for each integer *p*. Therefore, if for all , then

.

Since for all integers *p*, . By Wilson’s Theorem, if and only if *p* is prime. Therefore, *p* must be prime.

**Theorem 2**: If , and for all , then *p* is prime.

**Proof**: The Stirling numbers obey the following inversion formula:

Also, for each integer *p*. Thus, if for all , we have, for and :

The set of solutions to this congruence is the set of primes, as

Therefore, *p* must be prime.

**Theorem 3**: If , and for all , then *p* is prime.

**Proof**: We know from basic properties of Stirling numbers that . Therefore, if for all , then we have

Again, by Wilson’s Theorem, if and only if *p* is prime. Therefore, *p* must be prime.

(For those who wish to see solutions to Problems 51a and 51b as stated in *Concrete Mathematics*, the text contains outlines of the solutions in the back, as it does with all problems.)