TITLE: To prove that $ [n/1]+ [n/2]+[n/3]+\dots +[n/n]+[\sqrt{n}]$ is even.
QUESTION [17 upvotes]: Let $n$ be a natural number. How do you prove that 
$$ \lfloor n/1 \rfloor+ \lfloor n/2\rfloor+ \lfloor n/3\rfloor+\dots +\lfloor n/n]+\lfloor \sqrt{n}\rfloor$$
is even? Thanks.

REPLY [8 votes]: Let $f(n)$ be the sum. It is useful to rewrite it as
$$ f(n) = [\sqrt{n}] + \sum_{k=1}^{+\infty} [n/k] $$
What is $f(n) - f(n-1)$? The differences in the two formulas are:

Each of the terms $[n/k]$ is one larger than $[(n-1)/k]$ if and only if $k | n$. (this includes $k=n$)
If $n$ is a perfect square, then $[\sqrt{n}]$ is one larger than $[\sqrt{n-1}]$.

The effect of the first bullet adds $1$ for every factor of $n$. Most numbers have an even number of factors (e.g. if $x$ divides $n$, then so does $n/x$). The only exceptions are the perfect squares, which have an odd number of factors, but those are precisely the times when the second bullet point adds $1$.
Thus, $f(n) - f(n-1)$ is always even.