I wonder if anybody can help me with this problem.


I'm trying to compute the Mertens function for large $n$. The most obvious algorithm is just to compute all primes up to $\sqrt{n}$ and then to sieve. That takes at least an order of $n\log n$ operations, and really even more. 


The most recent article that I could find that discusses methods to compute the function directly is dated 1994, and it proposes to do exactly that.


Are there any known algorithms that let you compute Mertens faster than by sieving? I know that $\pi(n)$ can be computed in $O(n^{2/3})$, I looked into that algorithm but it does not seem to be easily adaptable to my task. 


Alternatively, I could use an algorithm to compute $M(n+dn)-M(n)$ for $dn\ll n$ (say $dn\sim \sqrt{n}$ ) in $O(\sqrt{n})$ time or less.



Computing the Mertens function
[This](https://projecteuclid.org/journals/experimental-mathematics/volume-5/issue-4/Computing-the-summation-of-the-M%C3%B6bius-function/em/1047565447.full) article presents an algorithm to compute Mertens function in $O(x^{2/3}(\log \log x)^{1/3})$ time and $O(x^{1/3}(\log \log x)^{2/3})$ space, I wonder if it is the same one you are referring to. On the other hand people sometimes make use of certain recursions such as the results in [this paper](https://www.unirioja.es/cu/jvarona/downloads/Benito-Varona-TOMATJ-Mertens.pdf) to compute things about the Mertens function. [This](https://web.archive.org/web/20170808045325/http://www.emis.ams.org/journals/EM/expmath/volumes/13/13.4/Kotnik.pdf) paper seems to claim that these algorithms haven't been improved upon.


