Let \(n\) be an integer. Denote by \(\phi(n)\) the number of integers from \(1\) to \(n-1\) coprime to \(n\). Find \(\phi(n)\) in the following cases:
\(n\) is a prime number.
\(n = p^k\) for a prime \(p\).
\(n=pq\) for two different primes \(p\) and \(q\).