Problem

Source: MEMO 2022 T7

Tags: number theory, functional equation



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$.