Answer
$n-\left \lfloor{\frac{n}{q}}\right \rfloor$-$\left \lfloor{\frac{n}{p}}\right \rfloor+1$.
Work Step by Step
Given n=pq where p and q are primes.
A number x is relatively prime to n if it x and n have no common factor other than .
Since n has three factors p, q and n itself. Therefore, for a number x to be relatively prime to n, must not be divisible by p, q and n.
By inclusion-exclusion principle such numbers =
n -(Numbers less than n that are divisible by p + numbers less than n that are divisible by q-1 ). Minus 1 because n is counted twice as it is both divisible by p and q.
Now, Numbers less than n that are divisible by p =$\left \lfloor{\frac{n}{p}}\right \rfloor$
Numbers less than n that are divisible by q =$\left \lfloor{\frac{n}{q}}\right \rfloor$.
Hence, the number of positive integers not exceeding n that are relatively
prime to n are
$n-\left \lfloor{\frac{n}{q}}\right \rfloor$-$\left \lfloor{\frac{n}{p}}\right \rfloor+1$.