Suppose we are interested in the sum

$\sum _{n\leq x}a_n.$

The study of the sum

$\sum _{n\leq x}a_n\log (x/n)$

may be easier.

What can one say about the first sum from knowing the behaviour of the second?

In the case I have in mind, I have

$\sum _{n\leq x}a_n\log (x/n)=x+\mathcal O\left (x^{1/2}\right )$

and would like a similar result for the sum without weights.

How feasible is this? I'm quite sure an asymptotic formula holds for the sum without weights, but I don't know if I should expect to lose a power saving. (Logarithms and epsilons in the error are not of concern.)

I'm not sure which properties exactly of the $a_n$ are important. It may be useful that they are all non-negative.

Any pointers as to what one should expect in such a situation would be very much appreciated.

If it seems that one can't really say much without knowing at least something more about the $a_n$ I can give some more details. But I think my problem has more to do with the fact that I'm lacking some general principles in dealing with weights, so I'll leave the $a_n$ arbitrary for now.

Thanks very much in advance.