402+40+41=40(40+1)+41=40×41+41=(40+1)41=412.
In general, it is quite straightforward to show that no polynomial of this kind can yield a formula for primes, even ifwe allow powers higher than 2 to enter the expression.
It is possible to devise tests for primality of a number that can be stated in a few words. However, to be of use they would need to be quicker, at least in some cases, than the direct verification procedure described in Chapter 1. A famous result goes by the name of Wilson’s Theorem. Its statement involves the use of numbers calledfactorials, which we will meet again in Chapter 5.The number n!, read‘nfactorial’, is just the product of all numbers up to n. For example,5!=5×4×3×2=120. Wilson’s Theorem is then a very succinct statement:a number p is prime ifand only ifp is afactor of 1+(p-1)!.