Problem: Given n-th prime, how do you find (n+1)-th prime? Write a function int GetNextPrime(int n); Example: Input: 7 Output: 11 Input: 13 Output: 17 Hint: Search for Bertrand's Postulate!
Where r u from man !!! ... You seriously are sooooooooo intelligent ...... i wud really like to see all the code and algo that you have written on your own and that is soooooo optimum .....
Can you please show me the code to the prob mentioned here ?
@ tekpiks Thanks for the reply and encouragement. However, I didn't designed any algorithm on myself. Considering the problem mentioned in this post, I just found out a mathematical concept of distance between prime numbers (see Bertrand's Postulate). I can show you all the code and algorithmic steps, but it's better for you if you first try to explore things on behalf of hints given here and try to code yourself! Keep visiting.
2 comments:
Where r u from man !!! ... You seriously are sooooooooo intelligent ...... i wud really like to see all the code and algo that you have written on your own and that is soooooo optimum .....
Can you please show me the code to the prob mentioned here ?
@ tekpiks
Thanks for the reply and encouragement. However, I didn't designed any algorithm on myself. Considering the problem mentioned in this post, I just found out a mathematical concept of distance between prime numbers (see Bertrand's Postulate). I can show you all the code and algorithmic steps, but it's better for you if you first try to explore things on behalf of hints given here and try to code yourself!
Keep visiting.
Post a Comment