Let $n = p^2 q$ where $p$ and $q$ are distinct prime numbers. How many numbers $m$ satisfy $1 \leq m \leq n$ and $\gcd (m, n) = 1$? Note that $\gcd (m, n)$ is the greatest common divisor of $m$ and $n$.
- $p(q - 1)$
- $pq$
- $(p^2- 1) (q - 1)$
- $p(p - 1) (q - 1)$
My attempt:
Using prime factorization :
Eulers function is $\phi(p^n)$ is $p^{n-1}(p-1)$
given that $n=p^2q(p,q$ prime$)$
$\phi(p^2q)=\phi(p^2)*\phi(q) =p(p-1)(q-1)$
Can you explain in alternative/formal way? Please.
as requested in the comments:
We can do this via the Principle of Inclusion/Exclusion.
There are exactly $pq$ numbers $1≤m≤p^2q$ which are divisible by $p$.
There are exactly $p^2$ which are divisible by $q$.
There are exactly $p$ which are divisible by both $p$ and $q$.
Thus: $$\varphi(p^2q)=p^2q-pq-p^2+p=p(p-1)(q-1)$$