GroupTheory
logp
compute the exponent of a prime power
Calling Sequence
Parameters
Description
Examples
logp( q )
q
-
: algebraic : an expression understood to represent a prime power
Suppose that q is a power pe of a prime number p. The calling sequence logp( q ) returns the exponent e. This is equivalent to log[p]( q ), except that the base p of the logarithm is not generally known in advance.
if q is a complex numeric that is not a power of a prime number then an exception is raised.
Otherwise, logp returns unevaluated.
Note that logp( 1 ) = 0.
with⁡GroupTheory:
logp⁡4
2
logp⁡2187
7
log3⁡2187
logp⁡181736602529563493772743207707225769267002557282133466635618621760664905776528650031297111433653361343413114922459355399125487176436206484922550339694292920308157658467185877862180743883366036055136650822122616340543983928298650053040147667730642467144039525033795872181721299778170114597245492905373163846425438075219742329773361475927592940713048575880678546342130536113739941714275612111016665973756986008654306628846785243192761535108469557914902031935282908398924790619171882023179658219569037894456670662283812638909841438734208283201
40
The following call results in an exception being raised as the argument is not a power of a prime number.
logp⁡12
Error, (in GroupTheory:-logp) argument is not a prime power
logp⁡1
0
logp⁡272⁢f+4
6⁢f+12
logp⁡u+v
See Also
ilog
ilog2
type/primepower
Download Help Document