This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)

PrimePowerQ

PrimePowerQ[expr]
yields True if expr is a power of a prime number, and yields False otherwise.
  • PrimePowerQ[m+In] automatically works over the Gaussian integers.
Test whether a number is a power of a prime number:
Test whether a number is a power of a prime number:
In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=
Integers:
Gaussian integers:
PrimePowerQ works with numbers of any size:
PrimePowerQ threads automatically over lists:
Gaussian rationals:
Test whether a number is a power of a Gaussian prime:
The first prime powers that are not prime:
The infinite sum of reciprocals of prime powers which are not prime converges:
The number of prime powers in intervals of size :
A graph showing the growth of the prime powers:
Recognize Mersenne numbers:
The number is a Mersenne number; is not:
Use FactorInteger to get the decomposition into primes:
The only square-free prime powers are prime numbers:
The sum of divisors of a prime power n is less than 2n:
Prime powers:
Gaussian prime powers:
New in 6