The basic idea: create a boolean array up to some limit, then starting from 2, mark all multiples of each prime as not-prime. Whatever's left unmarked is prime. One thing worth noting — since we need ...