Let $p,q,r$ be three distinct prime numbers and $m = p\times q\times r$. How many of the numbers {$1,2,...,m$} are relatively prime to $m$?
My attempt:
$m=2 \times 3 \times 5=30$,
$m=2\times 3 \times 7=42$,
$m=3\times 5\times 7=105$,
and I see the pattern that relatively prime numbers to $m$ are prime numbers(and their powers) except {$p,q,r$}. Prime factorization of $m$ is $p\times q\times r$ and I can maybe argue that $m$ cannot be divided by any other prime number.
But how do I prove this more formally ? I can't see any formal way to do it.
You can clearly see it from Euler's totient function.