well, that's that i use too.

because you are skipping odd numbers, try this:


(BTW, this is in VB)
data is an array of booleans.
everything else is an integer.

Code:
x = 3
While x * x <= endingPoint
    If data(x) = True Then
        a = x
        b = 2 * a
        a = a + b
        While a <= endingPoint
            data(a) = False
            a = a + b
        End While
    End If
    x = x + 2
End While