Problem

Source: Iranian third round 2019 Fianls number theory exam problem 1

Tags: number theory



Find all functions $f:\mathbb{N} \to \mathbb{N}$ so that for any distinct positive integers $x,y,z$ the value of $x+y+z$ is a perfect square if and only if $f(x)+f(y)+f(z)$ is a perfect square.