 iperfpow - Maple Help

iperfpow

determine if an integer is a perfect power Calling Sequence iperfpow( n ) iperfpow( n, 'p' ) Parameters

 n - expression p - name Description

 • If $n$ is a positive integer and $n={r}^{e}$, where $r$ and $e$ are positive integers with $1, then iperfpow( n ) returns r. If the second argument, p, is specified in the calling sequence, then it is assigned the value e.
 • It is an error for n to evaluate to a numeric which is not a positive integer.
 • This command returns FAIL if it is not able to establish that n is a perfect power of an integer.
 • In all other cases, the command returns unevaluated. Examples

 > $\mathrm{iperfpow}\left(256\right)$
 ${16}$ (1)
 > $\mathrm{iperfpow}\left(125,'p'\right)$
 ${5}$ (2)
 > $p$
 ${3}$ (3)
 > $\mathrm{iperfpow}\left(216,'p'\right)$
 ${6}$ (4)
 > $p$
 ${3}$ (5)
 > $\mathrm{iperfpow}\left(12\right)$
 ${\mathrm{FAIL}}$ (6)
 > $\mathrm{ifactor}\left(12\right)$
 ${\left({2}\right)}^{{2}}{}\left({3}\right)$ (7)
 > $\mathrm{iperfpow}\left(1,'p'\right)$
 ${1}$ (8)
 > $p$
 ${2}$ (9)
 > $\mathrm{iperfpow}\left(x\right)$
 ${\mathrm{iperfpow}}{}\left({x}\right)$ (10)
 > $\mathrm{iperfpow}\left(-25\right)$