16-2. Willans’s Formulas
C. P. Willans gives the following formula for the nth prime [Will]:
The derivation starts from Wilson’s theorem, which states that p is prime or 1 if and only if (p − 1)! ≡ −1(mod p). Thus,
is an integer for x prime or x = 1 and is fractional for all composite x. Hence
Thus, if π(m) denotes  the number of primes ≤ m,
 Our apologies for the two uses of π in close proximity, but it’s standard notation and ...