Problem

Source: 2021 Macedonian Team Selection Test P5

Tags: Divisibility, functions, algebra



Determine all functions $f:\mathbb{N}\to \mathbb{N}$ such that for all $a, b \in \mathbb{N}$ the following conditions hold: $(i)$ $f(f(a)+b) \mid b^a-1$; $(ii)$ $f(f(a))\geq f(a)-1$.