Skip to content

SquareFreePart ​

The square-free part qq of n=±s2qn=\pm s^2 q: the product of the primes dividing nn to an odd power.

SquareFreePart(n)qq in ∣n∣=s2q|n|=s^2 q with qq square-free; the sign of nn is a unit and is dropped.
Typed signatures
TypePackageApplies
(integer) -> integernumber-theoryalways

Domain: Number theory

Details
  • Every nonzero integer is ±s2q\pm s^2 q for a unique s≥1s\ge1 and square-free q≥1q\ge1; this is qq, and SquarePartRoot is ss. nn is square-free exactly when s=1s=1, and a perfect square (up to sign) when q=1q=1.
  • The sign is a unit, as in PrimeOmega, so q≥1q\ge1 always: SquareFreePart(−12)=3\mathrm{SquareFreePart}(-12)=3. Sage's squarefree_part keeps the sign instead.
  • Defined on nonzero integers; 0 stays unevaluated.
  • Also called the square-free kernel; that name is more often given to the radical, the product of the distinct primes, which is a different function. The radical is Wolfram Function Repository's IntegerRadical.

Plot

Examples

Basic #

12=22⋅312 = 2^2\cdot3

live ↗
InSquareFreePart(12)\mathrm{SquareFreePart}(12)Out33

18=32⋅218 = 3^2\cdot2

live ↗
InSquareFreePart(18)\mathrm{SquareFreePart}(18)Out22

A square-free number is its own square-free part

live ↗
InSquareFreePart(30)\mathrm{SquareFreePart}(30)Out3030
live ↗
InSquareFreePart(1)\mathrm{SquareFreePart}(1)Out11
Scope #

Negative nn: the sign is a unit, so the part is positive

live ↗
InSquareFreePart(−12)\mathrm{SquareFreePart}(-12)Out33

Listable over a list

live ↗
InSquareFreePart([8,9,10])\mathrm{SquareFreePart}(\bigl\lbrack8, 9, 10\bigr\rbrack)Out[2,1,10]\bigl\lbrack2, 1, 10\bigr\rbrack

Large integers: 10!=28⋅34⋅52⋅710! = 2^8\cdot3^4\cdot5^2\cdot7

live ↗
InSquareFreePart(10!)\mathrm{SquareFreePart}(10!)Out77
Applications #

Simplifying 1000=1010\sqrt{1000}=10\sqrt{10}: the radicand left over is the square-free part

live ↗
InSquareFreePart(1 000)\mathrm{SquareFreePart}(1\,000)Out1010
Properties #

n=s2qn=s^2 q. See SquarePartRoot

live ↗
In360=SquarePartRoot(360)2SquareFreePart(360)360=\mathrm{SquarePartRoot}(360)^2\mathrm{SquareFreePart}(360)OutTrue\mathrm{True}

The part is always square-free. See IsSquareFree

live ↗
InIsSquareFree(SquareFreePart(360))\mathrm{IsSquareFree}(\mathrm{SquareFreePart}(360))OutTrue\mathrm{True}

A perfect square has part 1

live ↗
InSquareFreePart(144)\mathrm{SquareFreePart}(144)Out11
Possible issues #

Zero is outside the domain, so it stays unevaluated

live ↗
InSquareFreePart(0)\mathrm{SquareFreePart}(0)OutSquareFreePart(0)\mathrm{SquareFreePart}(0)
About
Examples12
Checked againstWolfram Language 11 agree1 differSageMath 11 agree1 unevaluated
CrosswalkWikipediaMathWorldWikidataOEIS ×2SageMath

Implementation

mappedwolframpackages/oracle/src/mappings.ts

Wolfram has no head for it; this is its definition over FactorInteger, with the sign of n a unit.

mappedsagepackages/oracle/src/mappings.ts

Sage's squarefree_part keeps the sign of n; this reads |n|.

See also: SquarePartRoot, IsSquareFree, FactorInteger, MoebiusMu