How many positive integers less than 2017 are divisible by 2 but not by 3?

2017/2 = 1008.5

1008 are divisable by 2

2,4,6,8,10,12, ... as you can see, every third one is also divisable by 3

2/3*1008 = 672

So 672 of them are not divisable by 3

Here is another way:

2017/2 =1008 divisible by 2 - 2017/6 =336 divisible by 6.

1008 - 336 =672 - divisible by 2 but not by 3.