SquareFreeQ

SquareFreeQ[expr]

gives True if expr is a square-free polynomial or number, and False otherwise.

SquareFreeQ[expr,vars]

gives True if expr is square free with respect to the variables vars.

Details and Options

  • SquareFreeQ is typically used to test whether a number or a polynomial is square free.
  • An integer n is square free if it is divisible by no perfect square other than 1.
  • SquareFreeQ[expr] returns False unless expr is manifestly square free.
  • With the setting GaussianIntegers->True, SquareFreeQ tests whether expr is Gaussian square free.
  • For integers m and n, SquareFreeQ[m+I n] automatically works over Gaussian integers.
  • The following options can be given:
  • GaussianIntegers Automaticwhether to allow Gaussian integers
    Modulus 0modulus for polynomial coefficients

Examples

open allclose all

Basic Examples  (2)

Test whether a number is square free:

The number 4 is not square free:

Scope  (5)

SquareFreeQ works over integers:

Gaussian integers:

Rational numbers:

Univariate polynomials:

Multivariate polynomials:

Specify the variable in a polynomial:

Polynomials over a finite field:

Test for large integers:

Options  (2)

GaussianIntegers  (1)

Test whether 2 is square free over integers:

Gaussian integers:

Modulus  (1)

Test whether is square free over integers:

Integers modulo 3:

Applications  (8)

Basic Applications  (3)

Highlight square-free numbers:

Generate random square-free integers:

Square-free Gaussian integers:

Number Theory  (5)

The central binomial coefficients Binomial[2n,n] are not square free for :

Find the fraction of the first numbers that are square free:

The result is close to :

The polynomial p[x]/PolynomialGCD[p[x],p'[x]] is always square free:

The distribution of square-free numbers over integers:

Plot the distribution:

The distribution of square-free numbers over the Gaussian integers:

Plot the distribution:

Properties & Relations  (8)

A number that is divisible by a square is not square free:

In the prime factorization of a square-free number, the exponents of primes are all 1:

PrimeNu is equal to PrimeOmega for square-free numbers:

MoebiusMu is zero for non-square-free integers:

Numbers that are prime powers and square free are prime numbers:

The discriminant of a quadratic non-square-free polynomial is 0:

Square factors can be found using FactorSquareFreeList:

Simplify symbolic expressions:

Neat Examples  (3)

Plot the prime numbers that are the sum of three squares:

Square-free Gaussian integers:

Plot the Ulam spiral of square-free numbers:

Wolfram Research (2007), SquareFreeQ, Wolfram Language function, https://reference.wolfram.com/language/ref/SquareFreeQ.html.

Text

Wolfram Research (2007), SquareFreeQ, Wolfram Language function, https://reference.wolfram.com/language/ref/SquareFreeQ.html.

CMS

Wolfram Language. 2007. "SquareFreeQ." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/SquareFreeQ.html.

APA

Wolfram Language. (2007). SquareFreeQ. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/SquareFreeQ.html

BibTeX

@misc{reference.wolfram_2024_squarefreeq, author="Wolfram Research", title="{SquareFreeQ}", year="2007", howpublished="\url{https://reference.wolfram.com/language/ref/SquareFreeQ.html}", note=[Accessed: 05-December-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_squarefreeq, organization={Wolfram Research}, title={SquareFreeQ}, year={2007}, url={https://reference.wolfram.com/language/ref/SquareFreeQ.html}, note=[Accessed: 05-December-2024 ]}