The only numbers of matter in [2,10] are those prime numbers that are 2, 3, 5, 7
So, let them say that a number cannot be divided by integers in [2,10] , this number cannot be divided by {2,3,5,7}
Which is also equal to the total number between [1,n] minus the whole number that is divisible by any combination {2,3,5,7} .
So, this is the interesting part: from [1,n] , how many numbers are divisible by 2? Answer: n/2 (why? Just because every 2 number has one number divided by 2)
Similarly, how many numbers are divisible by 5? Answer: n/5 ...
So do we have an answer? No, since we found out that we doubled the count of numbers separated by both {2, 5} and {2, 7} ..., so now we need their minus.
But wait, it looks like we're half as much as those divided by {2,5,7} ... so we need to add it back
...
Keep doing this until all the combinations are taken care of, so there should be a 2 ^ 4 combination, which is 16 in total, quite a bit to deal with.
Take a look at the inclusion-exclusion principle for a good understanding.
Good luck