Exercise
In step number 3 of
Eratosthenes' sieve the stop criterion
for the algorithm can be replaced by:
m >
n /2
m > -1 +
n
m >
n
No, if n = 50, then m = 7 is needed to remove 49 from the list
No, if n = 49, then m = 7 is needed to remove 49 from the list
Indeed, if
x is a nonprime in
L, then it has a divisor
which is less than or equal to
x and thus
less than or equal to
n.
Hence, we only have to consider those
m that are less than or equal to
n