Why does the complexity of (1/2 + 1/3 + 1/5 + ...) = loglogN?
<p>N * (½ + ⅓ + ⅕ + … ) = O(NloglogN)</p>

<p>Why does the complexity of (1/2 + 1/3 + 1/5 + ...) = loglogN? I don't understand</p>

<p>Here is the code:</p>

<pre><code>void sieve(int N) {
    bool isPrime[N+1];
    for(int i = 0; i &lt;= N;++i) {
        isPrime[i] = true;
    }
    isPrime[0] = false;
    isPrime[1] = false;
    for(int i = 2; i * i &lt;= N; ++i) {
         if(isPrime[i] == true) {
             // Mark all the multiples of i as composite numbers
             for(int j = i * i; j &lt;= N ;j += i)
                 isPrime[j] = false;
        }
    }
}
</code></pre>