iperfpow
determine if an integer is a perfect power
Calling Sequence
Parameters
Description
Examples
iperfpow( n )
iperfpow( n, 'p' )
n
-
expression
p
name
If n is a positive integer and n=re, where r and e are positive integers with 1<e, 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.
iperfpow⁡256
16
iperfpow⁡125,p
5
3
iperfpow⁡216,p
6
iperfpow⁡12
FAIL
ifactor⁡12
22⁢3
iperfpow⁡1,p
1
2
iperfpow⁡x
iperfpow⁡−25
Error, (in iperfpow) first argument must be a positive integer
See Also
integer
iroot
Download Help Document