logp - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

GroupTheory

 logp
 compute the exponent of a prime power

 Calling Sequence logp( q )

Parameters

 q - : algebraic : an expression understood to represent a prime power

Description

 • Suppose that $q$ is a power ${p}^{e}$ 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.

Examples

 > $\mathrm{with}\left(\mathrm{GroupTheory}\right):$
 > $\mathrm{logp}\left(4\right)$
 ${2}$ (1)
 > $\mathrm{logp}\left(2187\right)$
 ${7}$ (2)
 > $\mathrm{log}\left[3\right]\left(2187\right)$
 ${7}$ (3)
 > $\mathrm{logp}\left(181736602529563493772743207707225769267002557282133466635618621760664905776528650031297111433653361343413114922459355399125487176436206484922550339694292920308157658467185877862180743883366036055136650822122616340543983928298650053040147667730642467144039525033795872181721299778170114597245492905373163846425438075219742329773361475927592940713048575880678546342130536113739941714275612111016665973756986008654306628846785243192761535108469557914902031935282908398924790619171882023179658219569037894456670662283812638909841438734208283201\right)$
 ${40}$ (4)

The following call results in an exception being raised as the argument is not a power of a prime number.

 > $\mathrm{logp}\left(12\right)$
 > $\mathrm{logp}\left(1\right)$
 ${0}$ (5)
 > $\mathrm{logp}\left({27}^{2f+4}\right)$
 ${6}{}{f}{+}{12}$ (6)
 > $\mathrm{logp}\left(u+v\right)$
 ${\mathrm{logp}}{}\left({u}{+}{v}\right)$ (7)