Why does log n! = ψ(n) + ψ(n/2) + ψ(n/3) + ψ(n/4) + ...? I saw this formula - $\log n! = \sum_{k=1}^n\psi(\frac{n}{k})$ (where $\psi$ is the second Chebyshev function) - in a published paper (not a letter) of Ramanujan's with no citation.  To make it into a journal without citation, it must be fairly well-known, but I can't find a proof anywhere (the only other reference I can find at all is Mathworld, where it's presented without proof, and the citation is a dead-tree book of which Amazon is out).  I feel like it's probably pretty easy, but try as I might, I can't come up with it on my own.
 A: Turning my comment into an answer. I presume you are aware of the identity $\log k=\sum_{d\mid k}\Lambda(d)$. Summing this for $k$ from $1$ to $n$ we get
$$\log n!=\sum_{k=1}^n\log k=\sum_{k=1}^n\sum_{d\mid k}\Lambda(d)=\sum_{d=1}^\infty\sum_{\substack{d\mid k\\k\leq n}}\Lambda(d)\\=\sum_{d=1}^\infty\sum_{l\leq n/d}\Lambda(d)=\sum_{l=1}^\infty\sum_{d\leq n/l}\Lambda(d)=\sum_{l=1}^\infty\psi(d).$$
Explanation of the steps: third and fifth equalities follow by exchanging the two summations, the fourth one follows by writing $k=dl$ and summing over $l$ in place of $k$.
A: Yes, it’s a well-known identity. Think about how many factors of a prime $p$ are in $n!.$ There will be one for each multiple of $p$ less than it equal to $n$ where we count the multiple $n$ times if it’s a multiple of $p^n.$ Now for a given prime $p,$ $\psi(n)$ will contribute a factor for each prime $p$ less than or equal to $n$ with the proper muliplicity (since it also contributes a factor for all the prime powers).  Then $\psi(n/2)$ will contribute a factor for each multiples of $p$ of the form $2p^n,$ again counted with the correct multiplicity. And so on for $3p^n,$ $4p^n,$ etc. So we can see each prime $p$ is given the exact right number of factors so that the whole thing multiplies to $n!.$
