Problem

Source: MEMO 2023 T1

Tags: algebra



(a) A function $f:\mathbb{Z} \rightarrow \mathbb{Z}$ is called $\mathbb{Z}$-good if $f(a^2+b)=f(b^2+a)$ for all $a, b \in \mathbb{Z}$. What is the largest possible number of distinct values that can occur among $f(1), \ldots, f(2023)$, where $f$ is a $\mathbb{Z}$-good function? (b) A function $f:\mathbb{N} \rightarrow \mathbb{N}$ is called $\mathbb{N}$-good if $f(a^2+b)=f(b^2+a)$ for all $a, b \in \mathbb{N}$. What is the largest possible number of distinct values that can occur among $f(1), \ldots, f(2023)$, where $f$ is a $\mathbb{N}$-good function?