Problem

Source: India TST 2023 Day 3 P1

Tags: number theory



Let $\mathbb{N}$ be the set of all positive integers. Find all functions $f : \mathbb{N} \rightarrow \mathbb{N}$ such that $f(x) + y$ and $f(y) + x$ have the same number of $1$'s in their binary representations, for any $x,y \in \mathbb{N}$.