A squarefree number (also called quadratfrei; Shanks 1993) is a positive integer whose prime factorization contains no repeated factors. All primes are therefore trivially squarefree. The number 1 is by convention taken to be squarefree. The squarefree numbers are 1, 2, 3, 5, 6, 7, 10, 11, 13, 14, 15, ... (OEIS A005117). The squareful numbers (i.e., those divisible by a square number greater than 1) are 4, 8, 9, 12, 16, 18, 20, 24, 25, ... (OEIS A013929).
The Wolfram Language function SquareFreeQ[n]
determines whether a number is squarefree. Note that for technical reasons, the Wolfram Language considers 1 to be squarefree,
a convention that is consistent with defining a number to be squarefree when , where
is the Möbius function.
The number 1 therefore has the somewhat curious distinction of being simultaneously
a perfect square and squarefree.
Let where
is squarefree and
where
is divisible by a square number
greater than 1, so that
.
Then
|
(1)
| |||
|
(2)
|
for , where
is the Riemann zeta
function (Hardy and Wright 1979, p. 255).
The values of the first integers are plotted above on a
grid, with squarefree values shown in white. Clear
patterns emerge where multiples of numbers each share one or more repeated factor.
There is no known polynomial time algorithm for recognizing squarefree integers or for computing
the squarefree part of an integer.
In fact, this problem may be no easier than the general problem of integer
factorization (obviously, if an integer can be factored completely,
is squarefree iff it contains no duplicated
factors). This problem is an important unsolved problem in number
theory because computing the ring of integers
of an number field is reducible to computing the
squarefree part of an integer
(Lenstra 1992, Pohst and Zassenhaus 1997).
All numbers less than
in Sylvester's sequence are squarefree, and
no squareful numbers in this sequence
are known (Vardi 1991). Every Carmichael number
is squarefree. The binomial coefficients
are squarefree only for
, 2, 3, 4, 6, 9, 10, 12, 36, ..., with
no others less than
.
Using the alternative convention
, where
is the floor function,
the central binomial coefficients
are squarefree only for
,
2, 3, 4, 5, 7, 8, 11, 17, 19, 23, 71, ... (OEIS A046098),
with no others less than 1500.
For a positive integer , let
be the number of positive squarefree numbers
(Hardy and Wright 1979, p. 251). Then for
, 2, ..., the first few values are 0, 1, 2, 3, 3, 4, 5, 6,
6, 6, 7, 8, 8, 9, 10, 11, 11, ... (OEIS A013928).
Sums for
include
|
(3)
| |||
|
(4)
| |||
|
(5)
| |||
|
(6)
| |||
|
(7)
|
where
is the Möbius function.
The asymptotic number
of positive squarefree numbers
is given by
|
(8)
|
(Landau 1974, pp. 604-609; Nagell 1951, p. 130; Hardy and Wright 1979, pp. 269-270; Hardy 1999, p. 65). The asymptotic density is therefore (OEIS
A059956; Wells 1986, p. 28; Borwein and
Bailey 2003, p. 139), where
is the Riemann zeta
function. The values of
for
, 100, 1000, ... are 7, 61, 608, 6083, 60794, 607926, 6079291,
60792694, 607927124, 6079270942, ... (OEIS A071172).
Similarly, the asymptotic density of squarefree Gaussian integers is given by
(OEIS A088454), where
is Catalan's constant
(Pegg; Collins and Johnson 1989; Finch 2003, p. 601).
The Möbius function is given by
|
(9)
|
so indicates that
is squarefree. The asymptotic formula for
is equivalent to the formula
|
(10)
|
(Hardy and Wright 1979, p. 270)
Let be the number of consecutive
numbers
with
such that
and
are both squarefree.
for
, 1, ... are given by 1, 5, 33, 323,
3230, 32269, 322619, 3226343, 32263377, 322634281, 3226340896, ... (OEIS A087618).
Then
is given asymptotically by
|
(11)
| |||
|
(12)
|
(OEIS A065474; Carlitz 1932, Heath-Brown 1984), where
is the
th
prime and
is the Feller-Tornier
constant.