cubefree - Maple Help

type/squarefree

check for a square-free integer

type/cubefree

check for a cube-free integer

 Calling Sequence type( expr, squarefree ) type( expr, cubefree )

Parameters

 expr - any Maple expression

Description

 • The type( expr, squarefree ) command returns true if expr is a square-free integer, and false otherwise.  An integer is square-free if it is not divisible by the square of any prime number.
 • An integer is square-free if, and only if, it is equal to its radical.
 • The type( expr, cubefree ) command returns true if expr is a cube-free integer, and false otherwise.  An integer is cube-free if it is not divisible by the cube of any prime number.

Examples

 > $\mathrm{type}\left(6,'\mathrm{squarefree}'\right)$
 ${\mathrm{true}}$ (1)
 > $\mathrm{type}\left(12,'\mathrm{squarefree}'\right)$
 ${\mathrm{false}}$ (2)
 > $\mathrm{type}\left(12,'\mathrm{cubefree}'\right)$
 ${\mathrm{true}}$ (3)
 > $\mathrm{type}\left(54,'\mathrm{cubefree}'\right)$
 ${\mathrm{false}}$ (4)

The asymptotic natural density of square-free integers is equal to $\frac{6}{{\mathrm{\pi }}^{2}}=\frac{1}{\mathrm{zeta}\left(2\right)}$.

 > $N≔100000:$$\frac{\mathrm{nops}\left(\mathrm{select}\left(\mathrm{type},\left[\mathrm{seq}\right]\left(1..N\right),'\mathrm{squarefree}'\right)\right)}{N}$
 $\frac{{30397}}{{50000}}$ (5)
 > $\mathrm{evalf}\left(%\right)$
 ${\mathrm{lastexception}}$ (6)
 > $\mathrm{evalf}\left(\frac{6}{{\mathrm{\pi }}^{2}}\right)$
 ${0.6079271016}$ (7)

Similarly, the asymptotic natural density of the cube-free integers is $\frac{1}{\mathrm{zeta}\left(3\right)}$.

 > $N≔10000:$$\frac{\mathrm{nops}\left(\mathrm{select}\left(\mathrm{type},\left[\mathrm{seq}\right]\left(1..N\right),'\mathrm{cubefree}'\right)\right)}{N}$
 $\frac{{8319}}{{10000}}$ (8)
 > $\mathrm{evalf}\left(%\right)$
 ${\mathrm{lastexception}}$ (9)
 > $\mathrm{evalf}\left(\frac{1}{\mathrm{\zeta }\left(3\right)}\right)$
 ${0.8319073727}$ (10)