type/primepower - Help

type/primepower

check for a rational prime power

 Calling Sequence type( expr, primepower )

Parameters

 expr - any Maple expression

Description

 • This command returns true if expr is of type primepower, and false otherwise.
 • An expression is of type primepower if it is a positive integer of the form p^k, for some prime number p and some non-negative integer k.

Examples

 > $\mathrm{type}\left(0,'\mathrm{primepower}'\right)$
 ${\mathrm{false}}$ (1)
 > $\mathrm{type}\left(1,'\mathrm{primepower}'\right)$
 ${\mathrm{true}}$ (2)
 > $\mathrm{type}\left(4,'\mathrm{primepower}'\right)$
 ${\mathrm{true}}$ (3)
 > $\mathrm{type}\left(-8,'\mathrm{primepower}'\right)$
 ${\mathrm{false}}$ (4)
 > $\mathrm{type}\left(6,'\mathrm{primepower}'\right)$
 ${\mathrm{false}}$ (5)
 > $\mathrm{type}\left(\frac{2}{3},'\mathrm{primepower}'\right)$
 ${\mathrm{false}}$ (6)