How can I find the least prime number greater than a given number? For example, given 4, I need 5; given 7, I need 11.
I would like to know some ideas on best algor
I'd have a big lookup table and then search it for the given number and respond with the next in the sequence.
Works well if there is a known (sensible) upper limit on the range of given numbers.