hi venks,
have a look @ distribution of prime numbers, may be it will be useful to find out the logic....

Other wise consider n is ur prime number around 10000 digits as u said, try to divide (n-1) by k randomly generated numbers where k can be around 5(randomly generated number should be between 2 to rootOf(n-1) obvious one.....), and go on to (n-2)....(n-3)....(n-4) until u get the prime number........

But here u have to face the probability it will be more than 99% sure...To increase ur chance raise the value of k


Reply via email to