The Sieve is the most efficient that I know of.
But even one like yours can be improved two-fold by just considering odd numbers.
Just push 2 into the array and then start with 3.
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.