Find all functions $f : \mathbb{N} \to \mathbb{N}$ such that for any positive integers $m, n$ the number $$(f(m))^2+ 2mf(n) + f(n^2)$$is the square of an integer. Proposed by Fedir Yudin
Problem
Source: Kyiv City MO 2024 Round 1, Problem 11.5
Tags: functional equation, number theory, Functional Equations
29.01.2024 01:49
I claim $f(n)=n$ for all $n$ is the only solution. Let $P(m,n)$ denotes the given assertion. Then $P(1,1)$ gives $f(1)^2+3f(1)=x^2$ for some $x\in\mathbb{N}$, yielding $(2f(1)+3-2x)(2f(1)+3+2x)=9$, which implies $x=2$ and $f(1)=1$. Next, consider $P((p-1)/2,1)$ where $p>2$ is a prime. We have for some $q$, \[ f\left(\frac{p-1}{2}\right)^2 + p =q^2\Rightarrow \left(q-f\left(\frac{p-1}{2}\right)\right)\left(q+f\left(\frac{p-1}{2}\right)\right) = p \]from which we obtain $f((p-1)/2)=(p-1)/2$ for any $p>2$ prime. We now show $f(n^2)=f(n)^2$ for all $n$. Fix any $n$ and let $m=(p-1)/2$ for a large $p$. Then, $f(m)=m$ and for some increasing sequence $(x_p)$, we have \[ m^2 + 2mf(n) + f(n^2)= x_p^2 \Rightarrow (m+f(n))^2 + f(n^2)-f(n)^2 = x_p^2. \]Studying this, we find that \[ \left(x_p - m-f(n)\right)\left(x_p+m+f(n)\right) = f(n^2)-f(n)^2. \]If $f(n^2)\ne f(n)^2$ then note that $x_p+m+f(n)\mid f(n^2)-f(n)^2$ but $x_p+m+f(n)$ can take arbitrarily large values by making $p$ large, a contradiction. So, $f(n^2)=f(n)^2$ for all $n$. We finally fix $m\in\mathbb{N}$ and consider $n=n_p=(p-1)/2$ for which $f(n_p^2)=f(n_p)^2 = n_p^2$ and obtain that there is a sequence $(y_p)$ along which \[ f(m)^2 + 2mn_p + n_p^2 = y_p^2 \Rightarrow (n_p-m)^2 + f(m)^2 - m^2 = y_p^2. \]Reasoning analogous to above, we find $f(m)^2 = m^2$, namely $f(m)=m$ (as the range of $f$ is positive integers), as claimed.
29.01.2024 05:24
This same problem has also appeared in Indonesia KTOM Mock National Olympiad 2020 P3 as well:
30.03.2024 14:49
Let $P(x, y)$ be the given assertion. $P(1, 1)$ gives $f(1)(f(1) + 3)$ is a perfect square and $(f(1) + 1)^2 \leq f(1)^2 + 3f(1) < (f(1) + 2)^2$ which means $f(1) = 1$, $P\left(\frac{p - 1}{2}, 1\right) $ gives: $$f\left(\frac{p-1}{2}\right)^2 +\, p = k^2 \implies \left(k - f\left(\frac{p-1}{2}\right)\right)\left(k + f\left(\frac{p-1}{2}\right)\right) = p \implies f\left(\frac{p-1}{2}\right)^2 = \frac{p - 1}{2}$$ Now, $P\left(\frac{p - 1}{2}, n\right)$ gives $\left(\frac{p-1}{2}\right)^2 + 2\left(\frac{p-1}{2}\right)f(n) + f(n^2) = \left(\left(\frac{p-1}{2}\right) + f(n)\right)^2 + f(n^2) - f(n)^2 = k^2$ where $k$ is some integer, so we have: $$\left( k - \left(\frac{p-1}{2}\right) - f(n) \right) \left( k + \left(\frac{p-1}{2}\right) + f(n) \right) = f(n^2) - f(n)^2$$We know $( k + \left(\frac{p-1}{2}\right) + f(n) ) \mid f(n^2) - f(n)^2$, so taking sufficiently large $p$ gives $f(n^2) - f(n)^2 = 0 \implies f(n^2) - f(n)^2 = 0$. Now, take $P\left(m, \frac{p - 1}{2}\right)$ which gives $f(m)^2 + 2m\left(\frac{p-1}{2}\right) + \left(\frac{p-1}{2}\right)^2 = \left(\left(\frac{p-1}{2}\right) + m\right)^2 + f(m)^2 - m^2 = k^2$ where $k$ is some integer. Using the same method, we have: $$\left( k - \left(\frac{p-1}{2}\right) - m \right) \left( k + \left(\frac{p-1}{2}\right) + m \right) = f(m)^2 - m^2$$For sufficiently large p, $f(m)^2 - m^2 = 0 \implies f(m) = m$. So we are done.