[Math] Number of integers between 1 and 1000 that are divisible by 30 but not divisible by 16.

divisibilityelementary-number-theorygre-exam

enter image description here

I know that the number of integers between 1 and 1000 that are divisible by 30
is 33, and the number of integers between 1 and 1000 that are divisible by 16 is 62, but I do not know how to calculate the number of integers that is divisible by both 30 and 16, especially because they are not primes. Could anyone help me please?

Best Answer

It does not matter if they are primes.

So here we are trying to calculate the number of multiples of $30$ which are not multiples of $16$ below thousand. For this, we take all multiples of $30$ below thousand first, and then subtract from this, all numbers that are multiples of $30$ and $16$ which are below thousand.

Any number is a multiple of $30$ and $16$ if and only if it is a multiple of their least common multiple, which in our case is $240$, which I computed by prime factorization, if you wanted to know how that is done.

So the answer is the number of multiples of $30$ minus the number of multiples of $240$ which are less than thousand. This is then $33-4 = 29$.