Euler Phi Function of Prime Power

Theorem
Let $$p$$ be a prime number, $$p > 1$$.

Then:
 * $$\phi \left({p}\right) = p - 1$$.
 * $$\phi \left({p^n}\right) = p^n \left({1 - \frac 1 p}\right)$$

where $$\phi: \Z^*_+ \to \Z^*_+$$ is the Euler $\phi$ function.

Proof

 * $$\phi \left({p}\right) = p - 1$$ follows directly from the definition of prime number.

The only number less than or equal to a prime $$p$$ which is not prime to$$p$$ is $$p$$ itself.


 * Next, note that $$k \perp p^n \iff p \nmid k$$, which follows from Prime Not Divisor then Coprime.

There are $$p^{n-1}$$ numbers $$k$$ such that $$1 \le k \le p^n$$ which are divisible by $$p$$:

$$k \in \left\{{p, 2 p, 3 p, \ldots, \left({p^{n - 1}}\right), p}\right\}$$

Therefore $$\phi \left({p^n}\right) = p^n - p^{n-1} = p^n \left({1 - \frac 1 p}\right)$$.