How many numbers less than $x$ are co-prime to $x$ Is there a fast way , or a direct function to give the count of numbers less than $x$ and co-prime to $x$ .
for example if $x$ = 3 ; then $n = 2$ and if $x$ = 8 ; then $n = 4$.

Yes there is. First of all, you have to prime factorize your $x$, any put it in exponential form.  Suppose you have the number $x = 50$. The prime factorization is $5^2 * 2^1$.  Now take each number seperately. Take the bases and subtract 1 from all of them. $5-1=4$. $2-1=1$. Now evaluate the each base/exponent combination after subtracting the exponent by 1. $5^{2-1}=5$. $2^{1-1}=1$. Now multiply your answers. $(4)(1)(5)(1) = 20$. 
If you want to try out your examples, $3=3^1$. So your answer would be $(3-1)(3^{1-1}) = (2)(1) = 2.$ For your other example, $8=2^3. n=(2-1)(2^{3-1})=(1)(4)=4$.
I guess in general, prime factorize your $x$ to $a_1^{b_1}*a_2^{b_2}* ... * a_n^{b_n}$ and your answer will be $((a_1-1)(a_1^{b_1-1}))*((a_2-1)(a_2^{b_2-1}))*...*(a_n-1)(a_n^{b_n-1})$
