Radical of an integer (source code)

= Radical of an integer
{title2=$\operatorname{rad}(n)=\prod_{p\mid n}p$}
{wiki}

= Squarefree kernel
{synonym}

= Integer radical
{synonym}

The <radical of an integer> $n>0$ is the <product> of its distinct <prime factors>, each included exactly once. If the <prime factorization> is $n=p_1^{a_1}\cdots p_r^{a_r}$ with distinct <prime numbers> $p_i$ and positive <integer> exponents $a_i$, then
$$
\operatorname{rad}(n)=p_1\cdots p_r=\prod_{p\mid n}p.
$$
Thus the <radical of an integer> remembers which <prime factors> occur and forgets their <prime valuations>. At $n=1$, the <empty product> gives $\operatorname{rad}(1)=1$. The <domain of a function> here is the <positive integers>; zero is excluded. https://pub.math.leidenuniv.nl/~evertsejh/dio12-ex4.pdf[Jan-Hendrik Evertse, Diophantine approximation, Homework IV, Exercise 20: definition of the integer radical]{ref}

For example, $72=2^3\cdot3^2$ has distinct <prime factors> $2,3$, so $\operatorname{rad}(72)=2\cdot3=6$. Similarly,
$$
\operatorname{rad}(30)=30,\qquad
\operatorname{rad}(32)=2,\qquad
\operatorname{rad}(36)=6,
$$
using the <prime factorizations> $30=2\cdot3\cdot5$, $32=2^5$ and $36=2^2\cdot3^2$. The <prime omega function> counts the retained <prime factors>, while the <total number of prime factors> counts their occurrences before repetitions are removed.

The <radical of an integer> is its largest <squarefree divisor>. Indeed, a <squarefree divisor> chooses at most one copy of each <prime factor>, so it divides $\operatorname{rad}(n)$; the <radical of an integer> itself is a <squarefree divisor>. Consequently,
$$
\operatorname{rad}(n)\mid n,\qquad
\operatorname{rad}(n)\le n,\qquad
\operatorname{rad}(n)=n\ \Longleftrightarrow\ n\text{ is squarefree}.
$$
The last statement follows because every nonzero <prime valuation> is then one. It includes $n=1$, a <squarefree integer>. Applying the <radical of an integer> twice also changes nothing: $\operatorname{rad}(\operatorname{rad}(n))=\operatorname{rad}(n)$.

\Image[/integer-radicals-prime-support.png]
{title=The <radical of an integer> for $1\le n\le60$: <squarefree integers> lie on the diagonal, and horizontal families share their <prime support of an integer>}

For any <positive integers> $a,b$, the exact <product> rule is
$$
\operatorname{rad}(ab)=\frac{\operatorname{rad}(a)\operatorname{rad}(b)}{\operatorname{rad}(\gcd(a,b))}.
$$
To prove it, a <prime factor> dividing just one input occurs once in the numerator and not in the denominator. A <prime factor> dividing both occurs twice in the numerator and once in the denominator, since it divides their <greatest common divisor>. Each <prime factor> of $ab$ therefore remains exactly once. For <coprime integers>, the denominator is $\operatorname{rad}(1)=1$, proving the <radical of an integer> is a <multiplicative function>. It is not a <completely multiplicative function>: $\operatorname{rad}(4)=2\ne4=\operatorname{rad}(2)^2$.

For a worked example with shared <prime factors>, take $a=12$ and $b=18$. Their <greatest common divisor> is $6$, and $ab=216=2^3\cdot3^3$, so
$$
\operatorname{rad}(216)=\frac{6\cdot6}{6}=6.
$$
This explains why <prime support of an integer> is useful: questions about the presence of <prime factors> can discard their multiplicities. For example, the <squarefree divisors> of $72$ are exactly the <integer divisors> of $\operatorname{rad}(72)=6$, namely $1,2,3,6$. Also $\gcd(m,n)=1$ if and only if $\gcd(m,\operatorname{rad}(n))=1$, because <coprimality> depends only on shared <prime factors>.

A further characterization uses mutual <divisibility> of powers: for <positive integers> $a,b$,
$$
\operatorname{rad}(a)=\operatorname{rad}(b)
\quad\Longleftrightarrow\quad
\text{there exist }k,\ell\ge1\text{ with }a\mid b^k\text{ and }b\mid a^\ell.
$$
If their <prime supports of an integer> agree, sufficiently large $k,\ell$ make all the required <prime valuations> large enough. Conversely, these two <divisibility> relations force each <prime factor> of either input to divide the other. For $72$ and $36$, one can take $k=2$ and $\ell=1$: $72\mid36^2$ and $36\mid72$.