I want to store a list of primes, in a way that both allows me to iterate over it (in order) and to check quickly if a given prime is there.
What is the best way ?
Should I just use a list? In this case, I suppose that there is a builtin for binary search. What is it ?
Should I use both a list and a set ? I know this works from the point of view of efficiency, but I'd like a way that is a bit less messy ...