We need to count 3-digit numbers (100-999) divisible by 2 or 3 but not by 7.
First, we count numbers divisible by 2 or 3.
Divisible by 2: ⌊999/2⌋−⌊99/2⌋=499−49=450
Divisible by 3: ⌊999/3⌋−⌊99/3⌋=333−33=300
Divisible by 6 (both 2 and 3): ⌊999/6⌋−⌊99/6⌋=166−16=150
Divisible by 2 or 3: 450+300−150=600
Next, we subtract those also divisible by 7.
We need numbers divisible by (2 or 3) AND 7 = divisible by 14 or 21.
Divisible by 14: ⌊999/14⌋−⌊99/14⌋=71−7=64
Divisible by 21: ⌊999/21⌋−⌊99/21⌋=47−4=43
Divisible by 42 (LCM of 14 and 21): ⌊999/42⌋−⌊99/42⌋=23−2=21
Divisible by 14 or 21: 64+43−21=86
Final answer:
600−86=514
Therefore, the number of 3-digit numbers is 514.