i don't think it's equivalent to the sieve of eratosthenes even when the optimization of using only odds is used here is what sieve of sundaram looks like where we loop at a i and b j instead of i and j n limit initialize the sieve is prime true is prime i i is odd i n for all odd a such that a and a n for all odd b such that a b and ab n is prime ab false while sieve of eratosthenes using only odd integers roughly looks like this only one line is added n limit initialize the sieve is prime true is prime i i is odd i n for all odd a such that a and a n if not is prime a continue only this has changed for all odd b such that a b and ab n is prime ab false this also shows that the sieve of sundaram is less efficient than the sieve of eratosthenes and that its complexity is n log n since n grows asymptotically as log n compared to sieve of eratosthenes' n log log n since p grows asymptotically as log log n