Problem

Source: BMO 2019, Problem 1

Tags: function, number theory, prime numbers



Let $\mathbb{P}$ be the set of all prime numbers. Find all functions $f:\mathbb{P}\rightarrow\mathbb{P}$ such that: $$f(p)^{f(q)}+q^p=f(q)^{f(p)}+p^q$$holds for all $p,q\in\mathbb{P}$. Proposed by Dorlir Ahmeti, Albania