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
- [algogeeks] Re: how to find Previous Prime number? sathiya narayanan
- [algogeeks] Re: how to find Previous Prime nu... Dhyanesh
- [algogeeks] Re: how to find Previous Prim... SUDARSHAN IYENGAR
- [algogeeks] Re: how to find Previous ... Vijay Venkat Raghavan N
- [algogeeks] Re: how to find Previ... Venkatesh Dayalan
- [algogeeks] Re: how to find ... sathiya narayanan
- [algogeeks] Re: how to find Previous ... manu jose