Range of numbers not divisible by $2$ or $3$ or $5$ How many numbers lie in the range of $1331$ and $3113$ (Endpoints Inclusive) such that they are not divisible by $2$ or $3$ or $5$?
I came across this Number System question and was not able to figure out the way to get the answer. At first I thought to separate out the numbers which are divisible by the LCM of $2$, $3$ & $5$ but this will still leave some numbers which will be exclusively divisible by any one of $2$ or $3$ or $5$.
Another method I found out to solve these type of questions is by using the Euler's Totient method but I am not aware of this.
So can someone please explain a general way to solve these types of question?
General question can be : How many numbers lie in the range of $A$ and $B$ such that they are not divisible by $x$ or $y$ or $z$ and so on?

By nos I mean numbers.
For total nos between $1331$ and $3113  = 3113-1331 -1 = 1781$ (excluding end nos)
Of $1781$ nos , the nos divisible by $2  = 1781 +1 = 891$ (as the starting no is even so no of even nos is greater than no of odd nos  )
now nos which aren't divisible by $2 = 890$.
Of $890$ nos, nos which are divisible by $5$ but don't end in $0 =  1781/10= 178$
(as the nos ending in $0$ are already eliminated)
(for every $10$ nos there is one no divisible by $5$ and not ending in $0$)
so now, nos not divisible $2$ or $5 =  890 -178 = 712 $
now for  nos divisible by $3$,  take the nos from $1338$  to $3108$ which has $1770$  nos
for every $30$ nos , there are $10$ nos divisible by $3$ of which $5$ are also divisible by $2$  and one is divisible by $5$ but not ends in $0$.  So for every $30$ nos ,  $4$ nos are divisible by $3$ but not by $2$ or $5$
so of $1770$ nos there are $59$ sets of $30$ nos . hence $4 * 59 = 236 $ nos are divisible by $3$ but not by $2$ or $5$.
so nos not divisible by $2$ or $3$ or $5$ in given range  $712 - 236 = 476$
but we haven't taken  $3$ multiples in range $1331$ to $1338$ and $3108$ to $3113$
nos multiple of $3$ in this range is $= 1334$  (even and hence eliminated) , $1335$ (divisible by $5$ and ends in $5$) ,  $3111$(not eliminated)
so $476 - 1 = 475$ .
but i have excluded end nos  so adding $2$
$ = 475 + 2 = 477 $.
