# Consider set of integers between 1 000 and 9 999 inclusive. How many integers in this set: are divisible by 2? divisible by 3? divisible by 2 & 3?

Consider the set of integers between $$1000$$ and $$9 999$$ inclusive. How many integers in this set:

(i) are divisible by $$2$$?

(ii) are divisible by $$3$$?

(iii) are divisible by $$2$$ and $$3$$?

What I've tried so far:

(i) $$\frac{9999-1000}{2} = 4499.5$$

i.e. $$4499$$ (but since it's inclusive of $$1000$$), $$4499 + 1 = 4500$$.

(ii)$$\frac{9999-1000}{3} = 2999.66\dots$$

i.e. $$2999$$ (but since it's inclusive of $$9999$$), $$2999+1 = 3000.$$

I'm sure this logic/method of solving this question is wrong, and have come across many variations of this problem in exams before but do not know the reasoning behind solving it.

What are the steps for approaching such problems? Thanks!

• Consider the largest multiple of $2$ which is $\le 9999$ and divide that one by $2$. Then consider the largest multiple of $2$ which is $< 1000$ and divide that one by $2$ and then take the difference of the two quantities. With a similar reasoning you can solve the other questions. – Manlio Jun 8 '20 at 9:51
• Also, for part 3, a number being divisible by both 2 and 3 is the same as saying the number is divisible by 6. You can use the method @Manilo suggested for all the parts. – JC12 Jun 8 '20 at 9:56
• @Manlio is there any reason you included $9999$ but not $1000$? – James A Jun 8 '20 at 9:56
• @JamesA that is because the OP asks for the solutions between $1000$ and $9999$ included. $1000$ can be divided by $2$ so if you take the multiples $\le 1000$ you throw away an integer when taking the difference. This is a bit sketchy but I hope the idea is clear. – Manlio Jun 8 '20 at 10:10

Because the set of numbers includes both $$1,000$$ and $$9,999$$, its cardinality will be $$9,999-1,000+1=9,000$$.
(i) $$\frac{9,999-1,000+1}{2}=4,500$$ (This works because $$1,000$$ is a multiple of $$2$$.)
(ii) $$\frac{9,999-1,000+1}{3}=3,000$$ (This works because $$9,999$$ is a multiple of $$3$$.)
(iii) $$\frac{9,999-1,000+1}{6}-1=1,499$$ (This works because neither $$1,000$$ or $$9,999$$ is a multiple of $$6$$.)