TITLE: Summation of logs
QUESTION [8 upvotes]: Are there any useful identities for quickly calculating the sum of consecutive logs? For example $\sum_{k=1}^{N} log(k)$ or something to this effect. I should add that I am writing code to do this (as opposed to doing this on a calculator) so N can be very large.

REPLY [2 votes]: In the particular case of
$$
\sum_{k=1}^N\log k=\log N!=\log\Gamma(N+1)
$$
this is just the loggama function, which is implemented in many software systems. This is fast and accurate.
For example, it is lngamma in GP, lgamma in C (math.h), LogGamma in Mathematica, lnGAMMA in Maple, LogGamma in Magma, gammaln in MatLab, lnGamma in Mathcad, log_gamma in Sage, math.lgamma in Python, and gammaln in Perl (Math::SpecFun::Gamma).