Prime numbers (Eratosthenes)

From: JS (dsa._at_asdf.com)
Date: 12/29/04


Date: Wed, 29 Dec 2004 22:05:42 +0100


I need to implement the following algorithm where P needs to be modelled af
an array of booleans ( booleans[]P = new boolean[n + 1]).

But how do I write this in the {} thats gonna be executed as long as 2*i<=
n??

for (i = 2; 2*i <=n; i = i + 1)
//{remove from P all multiples of i};
//print the contents of P