Processing Forum
Help me please......
The Sieve of Eratosthenes identifies all prime numbers up to a given number n as follows:
2m, 3m, 4m, ...
as composite. (Thus in the first run we mark all even numbers greater than 2. In the second run we mark all multiples of 3 greater than 3.)
Write a function which takes as argument a maximum value. The function should return a vector of integers, each of which is prime. You should be able to determine how many prime numbers there are less than the max value.