# Mean and median of error term of average Euler-phi function

Lets $$\phi(n)$$ is Euler's phi function. Let's define error term $$d(n) = {E(n) \over n} = {1 \over n} \left(\sum_{i\le n}\phi(i) - {3 n^2 \over \pi^2}\right)$$

Is it known that asymptotic of mean (and median) of the first N values $$d(n)$$ is equal to 3/\pi^2?

$$\lim_{N\to\infty} {\sum_{n=1}^N d(n) \over N} = 3/\pi^2$$

I can't extract this fact from the papers Oscillations of the remainder term related to the Euler totient function and The Existence of a Distribution Function for an Error Term Related to the Euler Function.

Mathematica code

Update: bug fixed - the limit is not 1 but 3/π^2, as noticed below by GH from MO.

The limit is not $$1$$ but $$3/\pi^2$$ (in agreement with your Mathematica code). To see this, let us use the following result of Pillai and Chowla (On the error terms in some asymptotic formulae in the theory of numbers, (I), J. London Math. Soc. 5 (1930), 95-101): $$S(x):=\sum_{n\leq x}E(n)=\left(\frac{3}{2\pi^2}+o(1)\right)x^2.$$ We infer \begin{align*}\sum_{n=1}^N\frac{E(n)}{n}&=\int_{1-}^N\frac{dS(x)}{x}=\frac{S(N)}{N}+\int_1^N\frac{S(x)}{x^2}\,dx\\[8pt] &=\left(\frac{3}{2\pi^2}+o(1)\right)N+\int_1^N\left(\frac{3}{2\pi^2}+o(1)\right)dx\\[8pt] &=\left(\frac{3}{\pi^2}+o(1)\right)N.\end{align*}