## Task 5 - 201245

For each natural number $n \geq 1$ let

$$
f(n)=\sum_{k=1}^{n^{2}} \frac{n-[\sqrt{k-1}]}{\sqrt{k}+\sqrt{k-1}}
$$

Determine a closed-form expression for $f(n)$ (i.e., an expression that represents $f(n)$ in terms of $n$ such that its formation does not require a number of operations dependent on $n$ as in (1)).

Hint:

If $x$ is any real number, then $[x]$ denotes the integer for which $[x] \leq x<[x]+1$ holds.
Each of the summands given in (1) is extended by the appropriate factor $(\sqrt{k}-\sqrt{k-1})$, which results in the number 1 in the denominator. By partially expanding the bracket expressions for the summands, we obtain:

$$
f(n)=\sum_{k=1}^{n^{2}}(n(\sqrt{k}-\sqrt{k-1})-[\sqrt{k-1}](\sqrt{k}-\sqrt{k-1})
$$

The sum can be decomposed as follows:

$$
f(n)=\sum_{k=1}^{n^{2}} n(\sqrt{k}-\sqrt{k-1})-\sum_{k=1}^{n^{2}}[\sqrt{k-1}](\sqrt{k}-\sqrt{k-1})
$$

According to the rules for calculating with the summation symbol, the first sum in (2) is transformed, and we obtain:

$$
\begin{aligned}
\sum_{k=1}^{n^{2}} n(\sqrt{k}-\sqrt{k-1}) & =\sum_{m=1}^{n-1} \sum_{k=m^{2}+1}^{(m+1)^{2}}[\sqrt{k-1}](\sqrt{k}-\sqrt{k-1}) \\
& =\sum_{m=1}^{n-1} m \sum_{k=m^{2}+1}^{(m+1)^{2}}(\sqrt{k}-\sqrt{k-1}) \\
& =\sum_{m=1}^{n-1} m\left(\sum_{k=m^{2}+1}^{(m+1)^{2}} \sqrt{k}-\sum_{k=m^{2}}^{(m+1)^{2}-1} \sqrt{k}\right) \\
& =\sum_{m=1}^{n-1} m(m+1-m)=\sum_{m=1}^{n-1} m=\frac{1}{2} n(n-1)
\end{aligned}
$$

Using the results for both sums in (2), we finally obtain

$$
f(n)=n^{2}-\frac{1}{2} n(n-1)=\frac{1}{2} n(n+1)
$$

which is an expression of the desired form.

Adapted from [3]