This site is supported by donations to The OEIS Foundation.

# Squarefree numbers

Squarefree numbers are numbers not divisible by a square greater than 1. Alternately, they are numbers with all exponents in its prime factorization less than 2. Note that although 1 is a square, it is also squarefree. The squarefree numbers are sequence A005117, and the first few squarefree 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, 41, 42, 43, 46, 47, 51, 53, 55, 57, 58, 59, 61, 62, 65, 66, 67, ...

## Characteristic function

The characteristic function of squarefree numbers is given by

${\displaystyle q(n)=|\mu (n)|\,}$

where ${\displaystyle \scriptstyle \mu (n)}$ is the Möbius function. When ${\displaystyle \scriptstyle n}$ is squarefree ${\displaystyle \scriptstyle |\mu (n)|=1}$ and otherwise ${\displaystyle \scriptstyle |\mu (n)|=0.}$ The first few terms are

1, 1, 1, 0, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1, 0, ... (A008966)

Alternately,

${\displaystyle {\rm {q}}(n)\,\equiv \,1\,-\,{\bar {\rm {q}}}(n)\,\equiv \,\chi _{\{squarefree\}}(n)\,=\,1\,-\,\operatorname {sgn}[\Omega (n)\,-\,\omega (n)],\ n\,\geq \,1\,}$,

${\displaystyle \scriptstyle \operatorname {sgn}(n)\,}$ being the sign function, or

${\displaystyle {\rm {q}}(n)=\delta _{n}^{{\rm {rad}}(n)}\,}$, where ${\displaystyle \scriptstyle \delta _{i}^{j}\,}$ is the Kronecker delta and ${\displaystyle \scriptstyle {\rm {rad}}(n)\,}$ is the radical or squarefree kernel of ${\displaystyle \scriptstyle n\,}$.

## Squarefree counting function

The summatory quadratfrei function is defined as

${\displaystyle Q(n)\equiv \sum _{i=1}^{n}q(n)=\sum _{i=1}^{n}|\mu (n)|\,}$

The asymptotic density of squarefree numbers corresponds to the probability that 2 randomly chosen integers are coprime

${\displaystyle \lim _{n\to \infty }{\frac {Q(n)}{n}}=\prod _{n=1}^{\infty }{\bigg (}1-{\frac {1}{{p_{n}}^{2}}}{\bigg )}={\frac {1}{\zeta (2)}}={\frac {6}{\pi ^{2}}},\,}$

where ${\displaystyle \scriptstyle \zeta (s)\,}$ is the Riemann zeta function.