What are the odds two numbers are relatively prime? This is known to be $\frac{6}{\pi^2}$. The proof involves calculating averages of the Euler phi function. \[ \phi(1) + \phi(2) + \dots + \phi(n) \approx 3 \left(\frac{n}{\pi}\right)^2 + O(n \log n) \] So even though $\phi$ is rather noisy, it's sum is relatively "quiet" behaving like a parabola. Why does all the noise disappear?
I'm wondering how it is possible to compute the exactly coefficient of $n^2$ in this expansion. It seems like a coincidence.
For good measure I have plotted the $\sum \phi$ and $\sum \phi - (\cdot)^2$ as demonstration.
Also we could consider a related function $\displaystyle \theta(n) = n^2 \prod_{p|n} \left( 1 - \frac{1}{p^2}\right)$. Here $\theta(1) + \theta(2) + \dots + \theta(n) \approx c \cdot n^3 + \dots$ what's the procedure for computing the constant $c$?

