For a positive integer x drawn at random between 1 and 20000 inclusively, determine the probability that (x!+1)/(x+1) is a prime number.

(In reply to

mathematica solutions (so far) by Daniel)

Just nitpicking, but there is a flaw (easily remedied) in Daniels' otherwise excellent proof that x+1 must be prime

**"If x+1 is not prime then all of its prime factors are less than x and thus factors of x!, thus x!/(x+1) is an integer"**

Well this is not true for x = 3. x+1 = 4, which is composite, but x!/(x+1) = (3*2*1)/(2*2) is not an integer. All of 4's prime factors are in x!, but they are not there enough times to completely cancel out the (x+1) in the denominator.

This is not a problem for any larger x, although the proof needs to be extended. For instance, if x = 7, x+1 = 2*2*2, but 7*6*5*4*3*2/2*2*2 is easily integral. Even though there is only one 2 in the numerator, there are enough multiples of 2 to cancel out anything in the denominator.

*Edited on ***July 31, 2010, 9:35 am**