Problem

Source: 2021 Francophone MO Juniors p4

Tags: number theory, greatest common divisor, least common multiple, functional equation, functional, Francophone



Let $\mathbb{N}_{\geqslant 1}$ be the set of positive integers. Find all functions $f \colon \mathbb{N}_{\geqslant 1} \to \mathbb{N}_{\geqslant 1}$ such that, for all positive integers $m$ and $n$: \[\mathrm{GCD}\left(f(m),n\right) + \mathrm{LCM}\left(m,f(n)\right) = \mathrm{GCD}\left(m,f(n)\right) + \mathrm{LCM}\left(f(m),n\right).\] Note: if $a$ and $b$ are positive integers, $\mathrm{GCD}(a,b)$ is the largest positive integer that divides both $a$ and $b$, and $\mathrm{LCM}(a,b)$ is the smallest positive integer that is a multiple of both $a$ and $b$.