Given some upper bound $n$ is there an efficient way to calculate the following:
$$\sum_{i=1}^n \varphi(i) $$
I am aware that:
$$\sum_{i=1}^n \varphi(i) = \frac 12 \left( 1+\sum_{i=1}^n \mu(i) \left \lfloor \frac ni \right\rfloor ^2 \right) $$
Where:
$\varphi(x) $ is Euler's Totient
$\mu(x) $ is the Möbius function
I'm wondering if there is a way to reduce the problem to simpler computations because my upper bound on will be very large, ie: $n \approx 10^{11} $.
Neither $\varphi(x) $, nor $\mu(x) $, are efficient to compute for a large bound of $n$
Naive algorithms will take an unacceptably long time to compute (days) or I would need would need a prohibitively expensive amount of RAM to store look-up tables.