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.
Even in UBASIC, the computer can't do the factorial for numbers larger than 1014:
list
10 for X=3 to 20000
20 if (!(X)+1)@(X+1)=0 then
30 :Q=(!(X)+1)//(X+1)
40 :if prmdiv(Q)=Q then print X;Q
100 next
OK
run
4 5
6 103
10 329891
Illegal parameter in 20
?x
1015
OK
but we do see that even below that number, the only three valid X values (4, 6 and 10) are at the beginning of the range, but we don't know if the valid numbers just thin out rapidly or whether these three values are the only values.
|
Posted by Charlie
on 2010-07-30 12:44:52 |