# Sum of indicator function for square free integers

Define $$S(n)$$ as $$1$$ when $$n$$ is square-free, and $$0$$ otherwise. Now prove that: $$\displaystyle \sum_{n \leq x}{S(n)} \geq \lfloor x\rfloor - \displaystyle\sum_{2 \leq d \leq \sqrt{x} } { \frac{x}{d^2} }$$ I have tried to prove it by induction, i.e. assume true for $$x = x_0$$, then consider separate cases for $$x=x_0 +1$$ as follows:

1. $$x_0 + 1$$ is not divisible by any squares: Trivial to show inequality holds
2. $$x_0 + 1$$ is a square number: Trivial to show inequality holds
3. $$x_0 + 1$$ is not a square number but is divisible by some $$d^2$$.

It is the third case I am struggling with. I have also tried a counting argument but haven't come up with anything substantive. Any help would be appreciated.

$$\left\lfloor\frac x{d^2}\right\rfloor$$ is the number of multiples of $$d^2$$ up to $$x$$. If $$d^2\mid a\le x$$, then $$d\le\sqrt x$$. Thus, on the right-hand side we have the number $$\lfloor x\rfloor$$ of integers up $$x$$ and we subtract the numbers of the multiples of $$d^2$$ up to $$x$$ for all values of $$d$$ for which $$d^2\mid a\le x$$ could hold. That leaves at most the number of square-free integers up to $$x$$.