Determine all functions $f : \mathbb {N} \rightarrow \mathbb {N}$ such that $f$ is increasing (not necessarily strictly) and the numbers $f(n)+n+1$ and $f(f(n))-f(n)$ are both perfect squares for every positive integer $n$.
Problem
Source: MEMO 2022 T7
Tags: number theory, functional equation
02.09.2022 16:39
Ah well... Let $g(n)^2=f(n)+n+1$. As $f(n)\le f(n+1)$ we have $g(n)^2-n-1\le g(n+1)^2-(n+1)-1$ so $g(n)<g(n+1)$, which means $f(n)$ is strictly increasing. Since $f(f(n))+f(n)+1$ and $f(f(n))-f(n)$ are both perfect squares with difference $2f(n)+1$, we must have $f(f(n))+f(n)+1\le (f(n)+1)^2$. This means $f(f(n))\le f(n)^2+f(n)$, or $g(f(n))\le f(n)+1$. From this, $g(n)<g(n+1)$, $f(n)$ unbounded and $g(1)\ge 2$, we get $g(n)=n+1$ for all $n$, giving the only solution $f(n)=n^2+n$ which works.
02.09.2022 16:40
MEMO 2022 T7 wrote: Determine all functions $f : \mathbb {N} \rightarrow \mathbb {N}$ such that $f$ is increasing (not necessarily strictly) and the numbers $f(n)+n+1$ and $f(f(n))-f(n)$ are both perfect squares for every positive integer $n$. The answer is only $\boxed{f(x) = x^2 + x}$ for all $x \in \mathbb{N}$. It is easy to check that this work. Now, we will show that there are no other solutions. Claim 01. $f(f(x)) \le f(x)^2 + f(x)$ for any $x \in \mathbb{N}$. Proof. We have $f(f(a)) + f(a) + 1$ and $f(f(a)) - f(a)$ are both perfect squares. Furthermore $f(f(a)) + f(a) + 1 > f(f(a)) - f(a)$, and therefore if $f(f(a)) - f(a) = x^2$, then $f(f(a)) + f(a) + 1 \ge (x + 1)^2$. This implies \[ f(f(a)) + f(a) + 1 \ge f(f(a)) - f(a) + 2x + 1 \implies x \le f(a) \]i.e. $f(f(a)) - f(a) \le f(a)^2$ . Claim 02. $(f(x + 1) - f(x))^2 \ge 4(f(x) + x + 1)$. Proof. We have $f(a) + a + 1$ and $f(a + 1) + a + 2$ are both perfect squares. Assuming $f(a) + a + 1 = x^2$. Then, we have \[ f(a + 1) + a + 2 \ge (x + 1)^2 = f(a) + a + 2 + 2x \implies f(a + 1) \ge f(a) + 2x \]and therefore $(f(a + 1) - f(a))^2 \ge 4(f(a) + a + 1)$. Claim 03. $f(x) \ge x^2 + x$ for all $x \in \mathbb{N}$. Proof. We'll prove this by induction. Indeed, for $x = 1$, we have $f(1) + 2$ is a perfect square, and therefore we conclude that $f(1) \ge 2$. Now, suppose that $f(n) \ge n^2 + n$. Then, we have \[ (f(n + 1) - f(n))^2 \ge 4(f(n) + n + 1) \ge 4(n + 1)^2 \implies f(n + 1) \ge f(n) + 2(n + 1) = (n + 1)^2 + (n + 1) \]as desired. This therefore implies \[ f(x)^2 + f(x) \stackrel{\text{Claim 03}}{\le} f(f(x)) \stackrel{\text{Claim 01}}{\le} f(x)^2 + f(x) \]and thus $f(f(x)) = f(x)^2 + f(x)$ for all $x \in \mathbb{N}$. However, this implies that the inequality in Claim 03 is tight, and hence $f(x) = x^2 + x$ for all $x \in \mathbb{N}$, which obviously works.
10.11.2022 02:02
Here is my solution: https://calimath.org/pdf/MEMO2022-T7.pdf And I uploaded the solution with motivation to: https://youtu.be/X0zqfk8v-h4