= Squarefree counting function
{title2=$Q(x)$}
= Squarefree-count function
{synonym}
For a <nonnegative real number> $x$, the squarefree counting function counts positive <square-free integers>:
$$
Q(x)=\#\{n\in\mathbb Z:1\leq n\leq x,\ n\text{ is squarefree}\}.
$$
For example, $Q(10)=7$, counting $1,2,3,5,6,7,10$. The <Möbius function> gives the exact formula
$$
Q(x)=\sum_{1\leq d\leq\sqrt{x}}\mu(d)\left\lfloor\frac{x}{d^2}\right\rfloor.
$$
To see why, consider $\sum_{d^2\mid n}\mu(d)$. Only <square-free integers> $d$ contribute. Choosing their <prime factors> from the <primes> whose squares divide $n$ gives the <product> $\prod_{p^2\mid n}(1-1)$. This is one when there are no such <prime factors> and zero otherwise, so it is the <indicator function> of squarefreeness. Summing over the <positive integers> $n\leq x$ and exchanging two finite <sums> leaves $\lfloor x/d^2\rfloor$ multiples of each $d^2$. The <floor function> makes the formula exact for nonintegral $x$ too.
Back to article page