eliminate indexes which does not produce primes
for ( $ i = 1 ; $ i <= ( $ nNew - 1 ) / 2 ; $ i ++ ) for ( $ j = ( $ i * ( $ i + 1 ) ) << 1 ; $ j <= $ n / 2 ; $ j = $ j + 2 * $ i + 1 ) $ marked [ $ j ] = 1 ;