$\left[\frac n1\right]+ \left[\frac n2\right] + \cdots+\left[\frac nn\right]+\left[\sqrt n\right]$ is even

222 Views Asked by At

Let $n$ be any natural number. Prove that $\left[\dfrac n1\right]+ \left[\dfrac n2\right] + \left[\dfrac n3\right]+\cdots+\left[\dfrac nn\right]+\left[\sqrt n\right]$ is even.

I tried this by taking two different cases, when, $n$ is even and when $n$ is odd. But I could not establish any relation between the two. Please help to solve this problem and thanks a lot in advance.

P.S. Although nothing is mentioned in the question I think $[\ ]$ stands for greatest integer function as otherwise the sum would be in a fraction which is not even as only natural numbers are regarded as even.

1

There are 1 best solutions below

0
On

Use the fact that: $$ \sum_{i=1}^n\left\lfloor\frac{n}{i}\right\rfloor=\sum_{i=1}^n d(i) $$ where $d(\ )$ is the divisor function (RHS: there are $d(i)$ numbers dividing $i$, LHS: there are $\left\lfloor\frac{n}{i}\right\rfloor$ numbers at most $n$ divisible by $i$). All numbers have even number of divisors, except for the squares, and there are $\lfloor\sqrt{n}\rfloor$ of those, thus:

$$ \lfloor\sqrt{n}\rfloor+\sum_{i=1}^n\left\lfloor\frac{n}{i}\right\rfloor=\sum_{i=1}^n d(i)+1\{\exists k\in\mathbb{N}:i=k^2\} $$ And all terms in the sum on the RHS are even.