# Is there a forumla for number of primes preceding a natural number?

I am guessing there is no known analytical function which gives such a formula. This question came to mind while attempting a rather basic proof.

I am trying to show that the number of primitive $n$th roots of unity in the complex numbers (roots the powers of each of which give all the roots) is the number of integers (including 1) less than $n$ and relatively prime to it.

This is rather obvious statement as all the non-primitive roots of unity simply have composite number coefficents of $2\pi/n$ and using the de Moivre's theorem in the opposite direction. It is possible to show they are powers of the primitive roots of unity, but I am unsure using only this analysis I can formulate a proof, any ideas or help would be much appreciated.

-

Your question title and question statement are asking two different things. The function mentioned in the title is the Prime-counting function $\pi(n)$ while the function mentioned in your post is the Euler's totient function $\varphi(n)$. The function $\pi(n)$ counts the number of primes less than or equal to $n$, while the function $\varphi(n)$ countes the number of positive integers $k$ less than $n$ such that $\gcd(n,k)=1$. The number of primitive $n$th root of unity in the complex plane is equal to $\varphi(n)$.