TITLE: Reason for putting log weight for exponential sums over primes?
QUESTION [5 upvotes]: In analytic number theory, for example as in ternary Goldbach problem via circle method, when one has to deal with exponential sums over primes often people use von Mangoldt function or log weight. In other words, instead of 
$$
\sum_{p < X}e^{2 \pi i f(p)}
$$
one considers 
$$
\sum_{n < X} \Lambda(n) e^{2 \pi i f(n)}
$$
or
$$
\sum_{n < X} \log (n) 1_{\mathbb{P}}(n) e^{2 \pi i f(n)}
$$
where $1_{\mathbb{P}}$ is the characteristic function on the primes and $f$ is a polynomial with integer coefficients.
Is the reason for introducing these log weights only so that certain computation becomes less messy? or are there cases where introducing such weights was actually crucial? [are there even some philosophy behind this maneuver?]
Thank you very much!

REPLY [10 votes]: Ultimately, it is because of the fundamental theorem of arithmetic, which expresses each natural number $n$ as a product of the primes dividing it:
$$ n = p_1^{a_1} \dots p_k^{a_k}.$$
Taking logarithms to make this multiplicative formula additive, we conclude that
$$ \log n = \sum_{p,j: p^j|n} \log p $$
or in terms of the von Mangoldt function
$$ \log n = \sum_{d|n} \Lambda(d).$$
This formula is the starting point for many computations involving primes, and so we see that the logarithmic weighting enters in at the very beginning.