All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Probability
(x!+1)/(x+1) = prime number (Posted on 2010-07-30) Difficulty: 3 of 5
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.

No Solution Yet Submitted by K Sengupta    
Rating: 2.3333 (3 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
mathematica solutions (so far) | Comment 5 of 9 |

first there is a simple proof that x+1 must be prime

(x!+1)/(x+1) = x!/(x+1)   +  1/(x+1)
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, since 1/(x+1) is only an integer x=-2 then (x!+1)/(x+1) is only an integer when x+1 is prime.  Thus we can drastically reduce the search space to the primes less than 20000.  This reduces us from testing 20,000 values of x to only 2262.  Making it feasable with a reasonably fast home computer.

Now I am currently using the following Mathematica code to search for solutions.

#Begin code#
f[x_]:=(x!+1)/(x+1);
lst={};
lmt=PrimePi[20000];
cnt=0;
Print[Dynamic[lst]]
i=0;
ProgressIndicator[Dynamic[i/lmt]]
For[i=1,i<=lmt,++i,
x=Prime[i]-1;
p=f[x];
If[PrimeQ[p],
++cnt;
lst=Append[lst,x];
];
];
#end code#

so far it has returned the following x values:
4,6,10,28,772,1320

unfortunately I am currently at work and only have my netbook to run this code on.  Doubt it will finish before my shift, if it is not I will continue running it on my faster dual core at home and should probably have full solution by morning.  Otherwise if somebody has access to Mathematica on a faster computer feel free to run this code and report what you get.

Edited on July 30, 2010, 8:11 pm

update:
I found this website
http://www.mymathforum.com/viewtopic.php?f=40&t=13502

which shows a search for up to 10,000 giving only
4,6,10,28,772,1320,2620
so I have updated my search to start at the first prime after 10,000.

Edited on July 30, 2010, 8:57 pm
  Posted by Daniel on 2010-07-30 20:06:11

Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (1)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (14)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information