Totient of a Prime Power
Also known as phi p^k · euler totient prime power · totient of a power
Units aren’t used in this calculation — every value is a plain number.
Worked example: φ(2⁵) = 16 — press Try an example to run it live, then adjust anything.
Enter your known values, leave one input blank, and solves for the missing one. Tap a variable’s symbol to see what it means, with a typical value.
Totient of a Prime Power explained
Counting the numbers below that are coprime to it is easier than the general totient because there is only one prime to avoid. Of the candidates, the ones sharing a factor are exactly the multiples of p, and there are of those. Subtract: . For that is , which is just the odd numbers — every odd number below 32 is coprime to it, and there are 16.
Set k = 1 and the formula reduces to , the fact that everything below a prime is coprime to it. That special case is used constantly: it is why the multiplicative group mod p has p−1 elements, and therefore why Fermat's little theorem has the exponent it does.
Like the sum-of-divisors formula, this is a building block rather than a destination, because φ is multiplicative across coprime parts. . Every factor there came from this one formula. And as always, p must actually be prime — the derivation counted "multiples of p" as the only numbers sharing a factor, which is false the moment p is composite.
Totient of a Prime Power formula
- = Prime
- = Exponent
- = Totient
Missing one of these? Work it out first, then come back
- Prime — RSA Modulus, RSA Totient
- Exponent — Sum of Divisors of a Prime Power, Pythagorean Expectation
- Totient — RSA Totient, RSA Modulus