Square-free integer 10 is square-free, as its divisors greater than 1 are 2, 5, and 10, none of which is a perfect square (the first few perfect squares being 1, 4, 9, and 16)

In mathematics, a square-free integer (or squarefree integer) is an integer which is divisible by no perfect square other than 1. That is, its prime factorization has exactly one factor for each prime that appears in it. For example, 10 = 2 ⋅ 5 is square-free, but 18 = 2 ⋅ 3 ⋅ 3 is not, because 18 is divisible by 9 = 32. The smallest positive square-free numbers are

1, 2, 3, 5, 6, 7, 10, 11, 13, 14, 15, 17, 19, 21, 22, 23, 26, 29, 30, 31, 33, 34, 35, 37, 38, 39, ... (sequence A005117 in the OEIS)

Square-free factors of integers

The radical of an integer is its largest square-free factor. An integer is square-free if and only if it is equal to its radical.

Any arbitrary positive integer n can be represented in a unique way as the product of a powerful number (that is an integer such that is divisible by the square of every prime factor) and a square-free integer, which are coprime. The square-free factor, called the square-free part of the number, is the largest square-free divisor k of n that is coprime with n/k. The square-free part of an integer may be smaller than the largest square-free divisor.

Any arbitrary positive integer n can be represented in a unique way as the product of a square and a square-free integer:

$n=m^{2}k$ In this factorization, m is the largest divisor of n such that m2 is a divisor of n.

In summary, there are three square-free factors that are naturally associated to every integer: the square-free part, the above factor k, and the largest square-free factor. Each is a factor of the next one. All are easily deduced from a prime factorization: if

$n=\prod _{i=1}^{h}p_{i}^{e_{i}}$ is the prime factorization of n, where $p_{1},\ldots ,p_{h}$ are distinct prime numbers, then the square-free part is

$\prod _{e_{i}=1}p_{i},$ The square-free factor such the quotient is a square is

$\prod _{e_{i}{\text{ odd}}}p_{i},$ and the largest square-free factor is

$\prod _{i=1}^{h}p_{i}.$ For example, if $n=75600=2^{4}\cdot 3^{3}\cdot 5^{2}\cdot 7,$ the square-free part is 7, the square-free factor such that the quotient is a square is 3 ⋅ 7 = 21, and the largest square-free factor is 2 ⋅ 3 ⋅ 5 ⋅ 7 = 210.

No algorithm is known for computing any of these square-free factors which is faster than computing the complete prime factorization. In particular, there is no known polynomial-time algorithm for computing the square-free part of an integer, nor even for determining whether an integer is square-free. In contrast, polynomial-time algorithms are known for primality testing. This is a major difference between the arithmetic of the integers, and the arithmetic of the univariate polynomials, as polynomial-time algorithms are known for square-free factorization of polynomials (in short, the largest square-free factor of a polynomial is its quotient by the greatest common divisor of the polynomial and its formal derivative).

Equivalent characterizations

A positive integer n is square-free if and only if in the prime factorization of n, no prime factor occurs with an exponent larger than one. Another way of stating the same is that for every prime factor p of n, the prime p does not evenly divide n / p. Also n is square-free if and only if in every factorization n = ab, the factors a and b are coprime. An immediate result of this definition is that all prime numbers are square-free.

A positive integer n is square-free if and only if all abelian groups of order n are isomorphic, which is the case if and only if any such group is cyclic. This follows from the classification of finitely generated abelian groups.

A integer n is square-free if and only if the factor ring Z / nZ (see modular arithmetic) is a product of fields. This follows from the Chinese remainder theorem and the fact that a ring of the form Z / kZ is a field if and only if k is a prime.

For every positive integer n, the set of all positive divisors of n becomes a partially ordered set if we use divisibility as the order relation. This partially ordered set is always a distributive lattice. It is a Boolean algebra if and only if n is square-free.

A positive integer n is square-free if and only if μ(n) ≠ 0, where μ denotes the Möbius function.

Dirichlet series

The absolute value of the Möbius function is the indicator function for the square-free integers – that is, |μ(n)| is equal to 1 if n is square-free, and 0 if it is not. The Dirichlet series of this indicator function is

$\sum _{n=1}^{\infty }{\frac {|\mu (n)|}{n^{s}}}={\frac {\zeta (s)}{\zeta (2s)}},$ where ζ(s) is the Riemann zeta function. This follows from the Euler product

${\frac {\zeta (s)}{\zeta (2s)}}=\prod _{p}{\frac {(1-p^{-2s})}{(1-p^{-s})}}=\prod _{p}(1+p^{-s}),$ where the products are taken over the prime numbers.

Distribution

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{aligned}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}}}\\&\approx 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{aligned}} 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 results that

{\begin{aligned}Q(x)&=\sum _{d\leq {\sqrt {x}}}\mu (d)\left\lfloor {\frac {x}{d^{2}}}\right\rfloor =\sum _{d\leq {\sqrt {x}}}{\frac {x\mu (d)}{d^{2}}}+O(\sum _{d\leq {\sqrt {x}}}1)=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{aligned}} 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 c.

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).$ Recently (2015) the error term has been further reduced 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 4n +1, 4n +2, 4n +3 are all square-free. Otherwise, observing that 4n and at least one of 4n +1, 4n +2, 4n +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, if n satisfies a simultaneous congruence

$n\equiv -i{\pmod {p_{i}^{2}}}\qquad (i=1,2,\ldots ,l)$ for distinct primes $p_{1},p_{2},\ldots ,p_{l}$ , then each $n+i$ is divisible by pi 2. 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)}$ .

Table of $Q(x),{\frac {6}{\pi ^{2}}}x$ and $R(x)$ The table shows how $Q(x)$ and ${\frac {6}{\pi ^{2}}}x$ compare at powers of 10.

$R(x)=Q(x)-{\frac {6}{\pi ^{2}}}x$ , also denoted as $\Delta (x)$ .

$x$ $Q(x)$ ${\frac {6}{\pi ^{2}}}x$ $R(x)$ 10 7 6.1 0.9
102 61 60.8 0.2
103 608 607.9 0.1
104 6,083 6,079.3 3.7
105 60,794 60,792.7 1.3
106 607,926 607,927.1 - 1.3
107 6,079,291 6,079,271.0 20.0
108 60,792,694 60,792,710.2 - 16.2
109 607,927,124 607,927,101.9 22.1
1010 6,079,270,942 6,079,271,018.5 - 76.5
1011 60,792,710,280 60,792,710,185.4 94.6
1012 607,927,102,274 607,927,101,854.0 420.0
1013 6,079,271,018,294 6,079,271,018,540.3 - 246.3
1014 60,792,710,185,947 60,792,710,185,402.7 544.3
1015 607,927,101,854,103 607,927,101,854,027.0 76.0

$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

If we represent a square-free number as the infinite product

$\prod _{n=0}^{\infty }(p_{n+1})^{a_{n}},a_{n}\in \lbrace 0,1\rbrace ,{\text{ and }}p_{n}{\text{ is the }}n{\text{th prime}},$ then we may take those $a_{n}$ and use them as bits in a binary number with the encoding

$\sum _{n=0}^{\infty }{a_{n}}\cdot 2^{n}.$ The square-free number 42 has factorization 2 × 3 × 7, or as an infinite product 21 · 31  · 50 · 71 · 110 · 130 ··· Thus the number 42 may be encoded as the binary sequence ...001011 or 11 decimal. (The binary digits are reversed from the ordering in the infinite product.)

Since the prime factorization of every number is unique, so also is every binary encoding of the square-free integers.

The converse is also true. Since every positive integer has a unique binary representation it is possible to reverse this encoding so that they may be decoded into a unique square-free integer.

Again, for example, if we begin with the number 42, this time as simply a positive integer, we have its binary representation 101010. This decodes to 20 · 31 · 50 · 71 · 110 · 131 = 3 × 7 × 13 = 273.

Thus binary encoding of squarefree numbers describes a bijection between the nonnegative integers and the set of positive squarefree integers.

(See sequences A019565, A048672 and A064273 in the OEIS.)

Erdős squarefree conjecture

${2n \choose n}$ is never squarefree for n > 4. This was proven in 1985 for all sufficiently large integers by András Sárközy, and for all integers > 4 in 1996 by Olivier Ramaré and Andrew Granville.

Squarefree core

The multiplicative function $\mathrm {core} _{t}(n)$ is defined to map positive integers n to t-free numbers by reducing the exponents in the prime power representation modulo t:

$\mathrm {core} _{t}(p^{e})=p^{e{\bmod {t}}}.$ The value set of $\mathrm {core} _{2}$ , in particular, are the square-free integers. Their Dirichlet generating functions are

$\sum _{n\geq 1}{\frac {\mathrm {core} _{t}(n)}{n^{s}}}={\frac {\zeta (ts)\zeta (s-1)}{\zeta (ts-t)}}$ .

OEIS representatives are (t=2), (t=3) and (t=4).