yields True if expr is a power of a prime number, and yields False otherwise.
Details and Options
- PrimePowerQ is typically used to test whether a number is a power of a prime number.
- A prime power is a prime or an integer power of a prime.
- PrimePowerQ[n] returns True unless n is manifestly a prime power.
- With the setting GaussianIntegers->True, PrimePowerQ tests whether a number is a Gaussian prime power.
- PrimePowerQ[m+In] automatically works over Gaussian integers.
Examplesopen allclose all
PrimePowerQ works over integers:
PrimePowerQ threads over lists:
Basic Applications (4)
Number Theory (6)
Recognize Mersenne numbers, integers that have the form :
The number is a Mersenne number; is not:
The infinite sum of reciprocals of prime powers that are not prime converges:
The number of elements in a finite field is a prime power:
Compute the number of irreducible polynomials of degree n over a finite field of order q:
Compute for degree 5 and order 9:
The number of prime powers in intervals of size 1000:
A visualization of the growth of the prime powers:
The distribution of prime powers over integers:
The distribution of Gaussian prime powers:
Properties & Relations (11)
Prime powers are divisible by exactly one prime number:
The prime factorization of a prime power:
PrimePowerQ gives True for all prime numbers:
The only square-free prime powers are prime numbers:
Use PrimeNu to count the number of distinct divisors:
If PrimeNu returns 1, the number is a prime power:
PrimeOmega gives the exponent for a prime power:
MoebiusMu gives 0 for composite prime powers and for primes:
Use FactorInteger to test for prime powers:
Use MangoldtLambda to test for a prime power:
Primes that are congruent to 1 mod 4 are not prime powers in the Gaussian integers:
Wolfram Research (2007), PrimePowerQ, Wolfram Language function, https://reference.wolfram.com/language/ref/PrimePowerQ.html.
Wolfram Language. 2007. "PrimePowerQ." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/PrimePowerQ.html.
Wolfram Language. (2007). PrimePowerQ. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/PrimePowerQ.html