Matlab/Octave Eratosieve using minimal big-O iterations
Here's my solution
The loop clearly runs O(logn) times and it's easy to see that the number of operations is bounded above by the normal number of operations for SOE(2n) so it's within O(nlog(logn)) big-O running time

function [primes] = eratosieve(n)
    isprime = ones(n, 1);
    isprime(1) = false;
    m = 1;
    while(m ^ 2 &lt; n)
        nprimes = find(isprime(m + 1 : m * 2)) + m;
        mult = (m + 1) : (n/(m + 1));
        a = nprimes * mult;
        isprime(a(a&lt;=n)) = false;
        m *= 2;
    end
    primes = find(isprime);
endfunction