Asymptotic estimate of weighted sum

I have to find an asymptotic formula for $\displaystyle \sum_{n\leq x} (1+\lambda (n))\left[\frac{x}{n}\right]$. From an exercise in Apostol, $$\displaystyle \sum_{n\leq x} \lambda (n)\left[\frac{x}{n}\right] = \sum_{n\leq x}[\sqrt x] = O(x\sqrt x)$$ Also, we know that $$\displaystyle \sum_{n\leq x} \left[\frac{x}{n}\right] = x\log x +(2C - 1)x + O(\sqrt x)$$ Hence, $$\displaystyle\sum_{n\leq x} (1+\lambda (n))\left[\frac{x}{n}\right] = x\log x +(2C - 1)x + O(\sqrt x) + O(x\sqrt x) = x\log x +(2C - 1)x + O(x\sqrt x)$$ Is this an acceptable estimate?


Solution 1:

If what you wrote is correct then $$ \sum\limits_{n \le x} {\lambda (n)\!\left[ {\frac{x}{n}} \right]} = \sum\limits_{n \le x} {[\sqrt x ]} = \sum\limits_{n \le x} {\left( {\sqrt x + \mathcal{O}(1)} \right)} = x^{3/2} + \mathcal{O}(x). $$ Also, $$ \sum\limits_{n \le x} {\left[ {\frac{x}{n}} \right]} = x\log x + \mathcal{O}(x). $$ Therefore, $$ \sum\limits_{n \le x} {(1 + \lambda (n))\!\left[ {\frac{x}{n}} \right]} = x^{3/2} + x\log x + \mathcal{O}(x). $$