How many positive integers $\le 462$ are relatively prime to $462$

combinatoricselementary-set-theoryinclusion-exclusionprime numbers

How many positive integers less than or equal to $462$ are relatively prime to $462$?

My Approach
Well my approach is basically that we find $|A \cup B|$ where:

  • $A = \{\text{all prime numbers} \le 462\}$
  • $B = \{\text{every number which isn't a factor of } 462\}$

I just don't know how to calculate this so it is not an efficient method so please answer with a more efficient method. Thank you!

Best Answer

HINT: Euler's Totient function $\phi$ is multiplicative. In other words, if we have two positive integers $a$ and $b$ with $\gcd(a,b) = 1$, then $\phi(ab) = \phi(a)\phi(b)$. So, you can use prime factorization of $462$ to divide and conquer the problem.

Related Question