Problem:
Given $n$, Calculate $ \sum_{k=1}^{n} k\cdot \mu(k) $
This is the oeis series.
My Thoughts:
I need a sublinear algo, possibly something of the order of $n^{3/4}$ or $n^{2/3}$ time. Any algorithm better than $O(n)$ time complexity is welcome. If you can prove sub-linear is not possible you can tell me that as well.
You can assume $O(n^{2/3})$ memory is available.
My thoughts are in lines of generalising square free counting function. I know efficient ways of counting square free numbers ie $\sum_{k=1}^{n}|\mu(k)\ne0|$ . It uses trick similar to prime counting functions. Since prime counting function can be generalised to get prime summing function, so should be this. Possibly we can do similar generalising for $\sum_{k=1}^{n}|\mu(k)=1|$ and $\sum_{k=1}^{n}|\mu(k)=-1|$ as well. My ideas are still very vague, Needs refining.
Here is a method to sum square free numbers in $O(n^{1/2})$ time. Somehow we would have to now split them into two ie $|\mu(k)=-1|$ and $|\mu(k)=1|$
To summarise:
- Expected Time complexity: $O(n^{3/4})$ or better.
- Expected Space complexity: $O(n^{2/3})$ or better.