Let $n$ be a positive integer, and denote by $f(n)$ the smallest positive integer $k$ such that $\left[\frac{n^{2}}{k}\right]=\left[\frac{n^{2}}{k+1}\right]$. Determine the value of $\left[\frac{n^{2}}{f(n)}\right]+f(n)$!
$\frac{n^{2}}{i}-\frac{n^{2}}{i+1}<1$ is equivalent to $n^{2}<(i+1) i$, so it holds precisely when $i \geq n$. According to the condition,

$$
\left[\frac{n^{2}}{f(n)}\right]-\left[\frac{n^{2}}{f(n)+1}\right]=0, \quad \text { so } \frac{n^{2}}{f(n)}-\frac{n^{2}}{f(n)+1}<1
$$

From this, $f(n) \geq n_{0}$. Let's examine the value of $\left[\frac{n^{2}}{i}\right]+i$ for $n \leq i \leq f(n)$.

We will prove by complete induction that in this case $\left[\frac{n^{2}}{i}\right]+i=2 n$.

If $i=n$, then $\left[\frac{n^{2}}{i}\right]+i=n+n=2 n$.

If $\left[\frac{n^{2}}{i}\right]+i=2 n$ and $n \leq i<f(n)$, to show that $\left[\frac{n^{2}}{i+1}\right]+i+1=2 n$, it suffices to show that $\left[\frac{n^{2}}{i}\right]-\left[\frac{n^{2}}{i+1}\right]=1$.

Since $i \geq n$, $\frac{n^{2}}{i}-\frac{n^{2}}{i+1}<1$; thus $\left[\frac{n^{2}}{i}\right]-\left[\frac{n^{2}}{i+1}\right]<2$. On the other hand, $\left[\frac{n^{2}}{i}\right]-\left[\frac{n^{2}}{i+1}\right] \neq 0$, otherwise $f(n)$ would not be the smallest integer $k$ for which $\left[\frac{n^{2}}{k}\right]=\left[\frac{n^{2}}{k+1}\right]$. Since $\left[\frac{n^{2}}{i}\right]-\left[\frac{n^{2}}{i+1}\right]$ is a natural number, it can only be 1. This proves our statement.

In the case $i=f(n)$, we get: $\left[\frac{n^{2}}{f(n)}\right]+f(n)=2 n$.

Based on the work of Zsolt Katona (Fazekas M. Fóv. Gyak. Gimn., III. o.t.)