Problem

Source: Iranian Third Round 2020 Number Theory exam Problem3

Tags: number theory, function, sum of digits



Find all functions $f$ from positive integers to themselves, such that the followings hold. $1)$.for each positive integer $n$ we have $f(n)<f(n+1)<f(n)+2020$. $2)$.for each positive integer $n$ we have $S(f(n))=f(S(n))$ where $S(n)$ is the sum of digits of $n$ in base $10$ representation.