How many integers $\leq N$ are divisible by $2,3$ but not divisible by their powers? How many integers in the range $\leq N$ are divisible by both $2$ and $3$ but are not divisible by whole powers $>1$ of $2$ and $3$  i.e. not divisible by  $2^2,3^2, 2^3,3^3, \ldots ?$
I hope by using the inclusion–exclusion principle one may derive such a formula and part of the formula has a form 
$$
N-\left[\frac{N}{2} \right]+\left[\frac{N}{2^2} \right]-\left[\frac{N}{2^3} \right]+\cdots -\left[\frac{N}{3} \right]+\left[\frac{N}{3^2} \right]-\left[\frac{N}{3^3} \right]+\cdots+\left[\frac{N}{2 \cdot 3} \right]+\text{some terms like as $\pm \left[\frac{N}{2^i \cdot 3^j} \right]$}
$$
Question. What is the exact sign for a term $ \left[\frac{N}{2^i \cdot 3^j} \right]$?

The rules permit all numbers divisible by $6$, but excluding those also divisble by $4$ or $9$.
This is given by:
$$\lfloor\frac{N}{6}\rfloor-\lfloor\frac{N}{12}\rfloor-\lfloor\frac{N}{18}\rfloor+\lfloor\frac{N}{36}\rfloor$$
Firstly - Start by enumerating number of numbers divisible by 6.
Next term: Remove numbers divisible by 6 and 4. These are all numbers divisible by 12 since the intersection of prime factors is $3\times2^2$
Next term: Remove numbers divisible by 6 and 9. These are all numbers divisible by 18 since the intersection of prime factors is $2\times3^2$
Next term: Add back in the multiples of 36 since these are the numbers we have deducted twice; divisible by 6, 4, and 9. Intersection of prime factors is $2^2\times3^2$.
