If you break out the 2 check into a separate loop, this only needs to check odd numbers (3, 5, 7, ...).