Skip to content
← All questions

How is φ(pk)=pk−pk−1φ(p^k) = p^k - p^{k-1} derived?

To derive φ(pk)\varphi(p^k), we count the integers from 1 to pkp^k that are coprime to pkp^k. An integer is not coprime to pkp^k if and only if it shares a prime factor with pkp^k. Since pp is the only prime factor of pkp^k, the non-coprime integers are exactly the multiples of pp. There are pk−1p^{k-1} multiples of pp in the range [1,pk][1, p^k]. Subtracting these from the total pkp^k gives the count of coprime integers: φ(pk)=pk−pk−1\varphi(p^k) = p^k - p^{k-1}.

Conditions

  • pp is a prime number.
  • kk is a positive integer (implied by context).
  • The counting range is from 1 to pkp^k inclusive.

Reasoning, step by step

  1. Consider the integers from 1 to pkp^k.
  2. Identify the condition for an integer aa to NOT be coprime to pkp^k: gcd⁡(a,pk)>1\gcd(a, p^k) > 1.
  3. Since pp is the only prime factor of pkp^k, gcd⁡(a,pk)>1\gcd(a, p^k) > 1 if and only if pp divides aa.
  4. Count the number of multiples of pp in the range [1,pk][1, p^k]. These are p,2p,3p,…,pk−1⋅pp, 2p, 3p, \ldots, p^{k-1} \cdot p.
  5. The number of such multiples is pk−1p^{k-1}.
  6. Subtract the count of non-coprime integers from the total count of integers: pk−pk−1p^k - p^{k-1}.
  7. Conclude that φ(pk)=pk−pk−1\varphi(p^k) = p^k - p^{k-1}.

Example

Let p=2p=2 and k=3k=3, so pk=8p^k = 8. The integers from 1 to 8 are 1, 2, 3, 4, 5, 6, 7, 8. The multiples of 2 are 2, 4, 6, 8 (there are 23−1=42^{3-1} = 4 of them). The integers coprime to 8 are 1, 3, 5, 7. The count is 8−4=48 - 4 = 4. Using the formula: φ(8)=23−22=8−4=4\varphi(8) = 2^3 - 2^2 = 8 - 4 = 4.

Common misconceptions

  • Thinking that all even numbers are not coprime to pkp^k regardless of pp (only multiples of the specific prime pp are excluded).
  • Forgetting that the range includes pkp^k itself, which is a multiple of pp and thus not coprime.

Watch the explanation

Explore next

Answers are generated from source material and independently checked. Consult the original video or creator if something is unclear.