Let
Q(
x) denote the number of square-free integers between 1 and
x ( shifting index by 1). For large
n, 3/4 of the positive integers less than
n are not divisible by 4, 8/9 of these numbers are not divisible by 9, and so on. Because these ratios satisfy the
multiplicative property (this follows from
Chinese remainder theorem), we obtain the approximation: :\begin{align}Q(x) &\approx x\prod_{p\ \text{prime}} \left(1-\frac{1}{p^2}\right) = x\prod_{p\ \text{prime}} \frac{1}{(1-\frac{1}{p^2})^{-1}}\\ &=x\prod_{p\ \text{prime}} \frac{1}{1+\frac{1}{p^2}+\frac{1}{p^4}+\cdots} = \frac{x}{\sum_{k=1}^\infty \frac{1}{k^2}} = \frac{x}{\zeta(2)} = \frac{6x}{\pi^2}.\end{align} This argument can be made rigorous for getting the estimate (using
big O notation) :Q(x) = \frac{6x}{\pi^2} + O\left(\sqrt{x}\right).
Sketch of a proof: the above characterization gives :Q(x)=\sum_{n\leq x} \sum_{d^2\mid n} \mu(d)=\sum_{d\leq x} \mu(d)\sum_{n\leq x, d^2\mid n}1=\sum_{d\leq x} \mu(d)\left\lfloor\frac{x}{d^2}\right\rfloor; observing that the last summand is zero for d>\sqrt{x}, it follows that {{NumBlk|:|Q(x) = \sum_{d\leq\sqrt{x}} \mu(d)\left\lfloor\frac{x}{d^2}\right\rfloor|}} :\begin{align} \phantom{Q(x)} &= \sum_{d\leq\sqrt{x}} \frac{x\mu(d)}{d^2}+O\left(\sum_{d\leq\sqrt{x}} 1\right) =x\sum_{d\leq\sqrt{x}} \frac{\mu(d)}{d^2}+O(\sqrt{x})\\ &=x\sum_{d} \frac{\mu(d)}{d^2}+O\left(x\sum_{d>\sqrt{x}}\frac{1}{d^2}+\sqrt{x}\right) =\frac{x}{\zeta(2)}+O(\sqrt{x}). \end{align} By exploiting the largest known zero-free region of the Riemann zeta function
Arnold Walfisz improved the approximation to :Q(x) = \frac{6x}{\pi^2} + O\left(x^{1/2}\exp\left(-c\frac{(\log x)^{3/5}}{(\log\log x)^{1/5}}\right)\right), for some positive constant . Under the
Riemann hypothesis, the error term can be reduced to :Q(x) = \frac{x}{\zeta(2)} + O\left(x^{17/54+\varepsilon}\right) = \frac{6}{\pi^2}x + O\left(x^{17/54+\varepsilon}\right). In 2015 the error term was further reduced (assuming also Riemann hypothesis) to :Q(x) = \frac{6}{\pi^2}x + O\left(x^{11/35+\varepsilon}\right). The asymptotic/
natural density of square-free numbers is therefore :\lim_{x\to\infty} \frac{Q(x)}{x} = \frac{6}{\pi^2}\approx 0.6079 Therefore over 3/5 of the integers are square-free. Likewise, if
Q(
x,
n) denotes the number of
n-free integers (e.g. 3-free integers being cube-free integers) between 1 and
x, one can show :Q(x,n) = \frac{x}{\sum_{k=1}^\infty \frac{1}{k^n}} + O\left(\sqrt[n]{x}\right) = \frac{x}{\zeta(n)} + O\left(\sqrt[n]{x}\right). Since a multiple of 4 must have a square factor 4=22, it cannot occur that four consecutive integers are all square-free. On the other hand, there exist infinitely many integers
n for which 4
n +1, 4
n +2, 4
n +3 are all square-free. Otherwise, observing that 4
n and at least one of 4
n +1, 4
n +2, 4
n +3 among four could be non-square-free for sufficiently large
n, half of all positive integers minus finitely many must be non-square-free and therefore :Q(x) \leq \frac{x}{2}+C for some constant
C, contrary to the above asymptotic estimate for Q(x). There exist sequences of consecutive non-square-free integers of arbitrary length. Indeed, for every tuple of distinct primes, the
Chinese remainder theorem guarantees the existence of an that satisfies the simultaneous congruence :n\equiv -i\pmod{p_i^2} \qquad (i=1, 2, \ldots, l). Each is then divisible by . On the other hand, the above-mentioned estimate Q(x) = 6x/\pi^2 + O\left(\sqrt{x}\right) implies that, for some constant
c, there always exists a square-free integer between
x and x+c\sqrt{x} for positive
x. Moreover, an elementary argument allows us to replace x+c\sqrt{x} by x+cx^{1/5}\log x. The
abc conjecture would allow x+x^{o(1)}.
Computation of The squarefree integers can be identified and counted in time by using a modified
Sieve of Eratosthenes. If only is desired, and not a list of the numbers that it counts, then () can be used to compute in time. The largest known value of , for , was computed by Jakub Pawlewicz in 2011 using an algorithm that achieves time, and an algorithm taking time has been outlined but not implemented.
Table of Q(x), x, and R(x) The table shows how Q(x) and \frac{6}{\pi^2}x (with the latter rounded to one decimal place) compare at powers of 10. R(x) = Q(x) -\frac{6}{\pi^2}x , also denoted as \Delta(x) . : R(x) changes its sign infinitely often as x tends to infinity. The absolute value of R(x) is astonishingly small compared with x . ==Encoding as binary numbers==