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
Problem
Source: BMO 2019, Problem 1
Tags: function, number theory, prime numbers
02.05.2019 15:37
Note that, $f(\cdot)$ is non-constant. Furthermore, if $f(\cdot)$ takes the same values at all odd primes, we have a contradiction (since $p^q=q^p$ is not possible if $p\neq q$ primes). Hence, there is a prime $q>2$ with $f(q)$ being odd. Take $p=2$, we have $f(2)^{f(q)}+q^2=f(q)^{f(2)}+2^q$. This yields $f(2)$ is even, and thus, $f(2)=2$. Now, take an arbitrary prime $p\neq 2$, and take $q=2$. We have, $f(p)^2+2^p=2^{f(p)}+p^2$. For convenience, let $f(p)=r$. We have, $r^2+2^p=2^r+p^2$, in other words, $2^p-p^2=2^r-r^2$. It is not hard to see that, the function $\phi(x)=2^x-x^2$ attains distinct values on integers, except $\phi(2)=\phi(4)$. Since $r\neq 2$, we deduce $\phi(r)=\phi(p)\implies r=p$. Namely, $f(p)=p$. Since $f(\cdot)$ is arbitrary, we deduce $f(x)=x$, for every $x\in\mathbb{P}$.
02.05.2019 15:56
Pretty much the same as above, Let $P(x,y)$ be the assertion of $x$ and $y$ to the original equation. Take $P(p,q)$ where $p$ and $q$ are both odd primes, and we must have \[ f(p)^{f(q)} \equiv f(q)^{f(p)} (\text{mod} 2) \]Which means that $f(p)$ and $f(q)$ are either both odd are both even. Suppose both of them are even, since $f : \mathbb{P} \to \mathbb{P}$, then $f(p) = 2$ for all odd primes $p$. Plugging back, we will get $p^q = q^p$ for any two odd primes $p,q$ which is indeed false. Therefore, $f(p)$ must be odd for odd primes $p$. Now, $P(2,p)$ where $p$ is an odd prime gives us $f(2) = 2$ as $f(2)$ and $f(p)$ must be different in parity, Again, $P(2,p)$ where $p$ is an odd prime gives us \[ 2^{f(p)} + p^2 = f(p)^2 + 2^p \]\[ 2^{f(p)} - f(p)^2 = 2^p - p^2 \]Suppose $g(x) = 2^x - x^2$. Checking the first few values : $g(1) = 1, g(2) = 0, g(3) = -1, g(4) = 0$. Claim. $g(x) = 2^x - x^2$ is strictly increasing for $x \ge 3$. Proof. It suffices to prove $g(x + 1) > g(x)$ for all $x \ge 3$. Base case is pretty much obvious. Suppose $2^{x + 1} - 2^x = 2^x > 2x + 1 = (x + 1)^2 - x^2 $ for $x \ge 3$. Where the last fact $2^x > 2x + 1$ for $x \ge 3$ is easily done by induction. Therefore, we must have $f(x) = x, x \in \mathbb{P}$.
02.05.2019 16:21
IndoMathXdZ wrote: Suppose $f(x) = 2^x - x^2$. Nice solution, but just to get out of confusion I think you should write $g(x)=2^x-x^2$ to don't mess up with the function we have to find.
02.05.2019 16:56
Is it possible to solve it with P(p,f(p)) and LTE
02.05.2019 17:00
Starlex wrote: Is it possible to solve it with P(p,f(p)) and LTE That is a high chance that wouldn't work (I think). But you can try.
02.05.2019 17:05
Let $P(x,y)$ be the assertion. Firstly it is simple to prove injectivity. Let $f(a)=f(b)$ Putting this into the starting equality we get $$a^b=b^a$$. As $a,b$ are primes $a=b$ We see that function has a trivial solution $$f(a)=a$$Let us prove that this is the only solution. Let's say there exists $f(x)$ not equal to $x$. As the function is injective we can say there exists $y$ such that $f(y)>y$. $$f(y)=y+m$$ Now we do $P(2,3)$ in the starting equality. We get $f(2)^{f(3)}+1=f(3)^{f(2)}$ One side is even so we find that $f(2)=2$ Now $$P(2,y)$$We get $2^y*(2^m-1)=m*(2y+m)$ For $m>4$ we have $2^m>m^2+1$ So $$m+2y\geq m*2^y$$However this does not stand ( simple to prove with Induction). Now we only have to check small cases. $$m=4$$$2^y+15=4*(2y+m) , mod2$ ends this. $$m=3$$$$2^y*7=6y+9$$This has no solutions for $y\geq 3$ $$m=2$$$$2^y*3=4y+4$$$mod 2$ and finally $m=1$ would mean$ x$ and $x+1 $are both prime and that is only the case with 2 and 3 but$ f(2)=2$. Therefore, the only solution is $$f(x)=x$$
02.05.2019 17:08
OOf looks like I got sniped, pretty much same as above
02.05.2019 21:41
letting p=2,q=3 you get $$f(3)^{f(2)} - f(2)^{f(3)} = 1$$by mihailescu's theorem, as $f(2), f(3) > 1$ the only solutions are $f(3) = 3, f(2) = 2$. It's not hard to show f is injective, if it is you end up with: $$q^p = p^q$$using calculus on the function $f(x) = \frac{x}{\ln{x}}$ you find the function is increasing for $x >= 3 > e$ so the only solution is $q=2,p=4$ and cyclic but 4 isn't prime hence f is injective. Now you can induct over f supposing that $f(p) = p$ $\forall p < q$. Now suppose $f(q) \neq q$. Clearly f(q) isn't less than q due to our idncutive hypothesis and inductivity property so $f(q) > q$. Now look at p=2: $$2^{f(q)} - (f(q))^2 + q^2 -2^q =0$$let $f(q)=x$ and define: $g(x) = 2^x - x^2 + q^2 - 2^q$ $g'(x) = 2^x \cdot \ln{2} - 2x$ $g increasing \rightarrow g'(x) > 0 \rightarrow 2^x \cdot \ln{2} > 2x$ It's easy to show that g is increasing for $x >= 2$ by induction. Since we have $g(q) =0$ equality will never happen for larger values of $f(q)$ hence $f(q)=q$ and so $f(p) = p \forall p \in \mathbb{P}$
02.05.2019 22:22
dangerousliri wrote: Proposed by Dorlir Ahmeti, Albania I knew that we would see one problem of yours today.
03.05.2019 20:34
dangerousliri wrote: 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 Here it is my solution that I send it in few details. As in above solutions after we find $f(2)=2$ we get $2^{f(p)}-2^p=f(p)^2-p^2$. We look only when $p$ is an odd prime number. We gonna show that if $r,s$ are odd positive integers greater then $1$ such that $2^r-2^s=r^2-s^2$ then $r=s$. To prove that we suppose on contrary that $r>s\Rightarrow r-2\geq s$ hence we have $3\cdot 2^{r-2}\leq 2^r-2^s=r^2-s^2\leq r^2-9$. Now easily we can prove by induction that $3\cdot 2^{r-2}>r^2-9$ for every positive integer $r\geq 5$.
05.05.2019 20:39
I will post the number theoretical solution I found during the contest. $f$ being injective is obvious as otherwise if $f\left(a\right)=f\left(b\right)$ then by putting in $a$ and $b$ we get $a^b=b^a$ which is obviously impossible for distinct primes. Now we show $f\left(2\right)=2$. Putting $p=2$ and $q$ odd gives $f\left(2\right)^{f\left(q\right)}-f\left(q\right)^{f\left(2\right)}=1\left(\operatorname{mod}2\right)$. So one of $f\left(2\right),\ f\left(q\right)$ is even. If $f\left(2\right)$ is not even, then $f\left(q\right)=2$ for all odd $q$, which contradicts injectivity. So $f\left(2\right)=2$. Now we use induction. Order the primes $p_1,\ p_2,\ ...$ so $p_1 = 2, p_2 = 3$ etc. Let $S$ be the set $p_i$ for $1\le i\le k$. Suppose $f\left(p\right)=p$ for all $p$ in $S$. Let $p_{k+1}=q$. We will show $f\left(q\right)=q$. First note by injectivity and the hypothesis that $f\left(q\right)\ge q$. Let $p$ be a prime in $S$. So using $f\left(p\right)=p$ from the hypothesis, $p^q\left(p^{f\left(q\right)-q}-1\right)=f\left(q\right)^p-q^p$. Thus $v_p\left(f\left(q\right)^p-q^p\right)\ge q$. As $f\left(q\right)^p-q^p=0\left(\operatorname{mod}p\right)$, by FLT, we also get $f\left(q\right)=q\left(\operatorname{mod}p\right)$. Obviously $p$ does not divide $q$, so now we can use LTE to get $q\le v_p\left(f\left(q\right)^p-q^p\right)=v_p\left(f\left(q\right)-q\right)+v_p\left(p\right)=v_p\left(f\left(q\right)-q\right)+1$ or $v_p\left(f\left(q\right)-q\right)\ge q-1$. Repeat this for all $p$ in $S$. I now claim that $f\left(q\right)-q$ must be a multiple of $q-1$. Note that $q-1<q$ so all prime factors of $q-1$ must come from $S$. We cannot have more than $q-1$ factors of such a prime in $q-1$ as this would imply $q-1\ge2^q$ (this is obviously impossible but to use a number theoretic proof, we know $q\le2^{q-1}-1$ as $q$ divides $2^{q-1}-1$, so $q<2^{q-1}<2^q + 1$). So for all primes dividing $q-1$, $f\left(q\right)-q$ has at least that many factors, thus $q-1$ divides $f\left(q\right)-q$. By what we just proved and FLT, $p^{f\left(q\right)}=p^q\left(\operatorname{mod}q\right)$ so from $p^{f\left(q\right)}-p^q=f\left(q\right)^p-q^p$ we get $f\left(q\right)^p=q^p=0\left(\operatorname{mod}q\right)$ using some $p$ from $S$. This implies $f(q)$ is a multiple of $q$, and as $f\left(q\right)$ is prime, $f\left(q\right) = q$.
09.05.2019 15:01
My solution is as follows: Find $f(2)=2$ and $f(3)=3$ as in the above solutions. Now, assume $f(p_k)=p_k$ for $k=1,2,\dots, n$. We then claim also for $q=p_{n+1}$ that $f(q)=q$. Taking $f(p_k)^{f(q)}+q^{p_k}=f(q)^{f(p_k)}+p_k^q (\mod p_k)$ and applying Fermat's Little theorem one obtains $f(q)\equiv q (\mod p_k)$. If $f(q)\neq q$, applying the Chinese Remainder theorem one obtains $f(q)\geq q+p_1p_2\dots p_n$. Taking $q$ and, say, $p=2$ one can ''easily'' show that the LHS is much greater than the RHS.
19.06.2019 16:23
I gave the same solution as NZP_IMOCOMP4 during the competition . How many marks out of 10 would this get and is it one of the acceptable solutions? Thanks in advance
28.11.2019 20:49
Can't we replace the range by natural numbers greater than $1$?Here is a solution:Plug in $p=3,q=2$ then by Catalan's Conjecture we get $f(3)=3$.Now plug $p=2$ It is easy to see that the function $2^x-x^2$ is injective so $f(p)=p$ for any prime.
20.04.2020 08:28
$$ P(2,q)\implies f(2)^{f(q)}+q^2=f(q)^{f(2)}+2^q\implies f(2)-even\implies f(2)=2 $$ $ f(2)^{f(q)}-f(q)^{f(2)}=2^q-q^2 $ Claim:$ 2^a-a^2\implies increasing,a\in\mathbb {N} $ Proof: $ (2^x-x^2)'=2^xln(2)-2x>0\implies 2^{x-1}ln(2)>x $ Claim:$ 2^{x-1}ln(2)-x>0 $ Proof: Induction$$ \implies 2^xln(2)=2(2^{x-1}ln(2))>2x>x+1 $$ $ Then $ $ f(q)=q $
28.04.2020 21:42
dangerousliri wrote: Starlex wrote: Is it possible to solve it with P(p,f(p)) and LTE That is a high chance that wouldn't work (I think). But you can try. in fact is really possible.
Attachments:
solution.docx (13kb)
28.04.2020 21:43
sorry is my first time posting something in aops....I really dont know how to copy and paste my solution. for the equation p^x-y^p=1 i have this solution in spanish.
Attachments:
LTE problema 2.docx (26kb)
18.08.2020 15:21
Very beautiful problem! For primes $p$ and $q$ we get that $$f(p)^{f(q)} \equiv f(q)^{f(p)} \pmod 2$$From there $f(p)$ and $f(q)$ have same parity. If they are even then because of codomain of function we have that $f(p) = 2$. So plugging back will give us that $$p^q = q^p$$And this obviously won't work for distinct primes $p$ and $q$ so $f(p)$ is odd. Now by plugging $(2, p)$ $$f(2)^{f(p)} + p^2 = f(p)^{f(2)} + 2^p$$From this we get that $f(2)$ is even and so from codomain we get that $f(2) = 2$. By pluggin $(2, p)$ once again we get that $$2^{f(p)} - f(p)^2 = 2^p - p^2$$Now let's denote function $\gamma(x) = 2^x - x^2$. It is easy to prove that it is strictly increasing and so from there we obtain $f(p) = p$ for all primes $p$.
15.02.2021 07:30
${\color{green}{\textbf{Claim:}}}$ $f(p)=p$ for all prime $p$. $\textit{Proof:}$ Let $P(p,q)$ denote the given assertion, we have \[P(3,2): f(3)^{f(2)}-f(2)^{f(3)}=3^2-2^3=1\]then, by $\textbf{Mihăilescu's theorem}$, we must have $f(3)^{f(2)}=3^2, f(2)^{f(3)}=2^3$, since $f: \mathbb{P} \rightarrow \mathbb{P}$, we must have $f(3)=3, f(2)=2$. Then, $P(p,2)$ gives \[2^{f(p)}-f(p)^2=2^p-p^2.\]Let $g(x)=2^x-x^2$, we now find the extremal points of $g(x)$, since $g'(x)=\ln 2 \cdot 2^x-2x$, by setting it equal to $0$ yields \[2^{x^{*}}=\frac{2x^{*}}{\ln 2}\]where $x^{*}$ are the extremal points, so $g(x^{*})=\frac{2x^{*}}{\ln 2}-(x^{*})^2=-\left(x^*-\frac{1}{\ln 2}\right)^2+\left(\frac{1}{\ln 2}\right)^2\le \left(\frac{1}{\ln 2}\right)^2< \left(\frac{1}{1-\frac{1}{2}}\right)^2=4$. Also, since $2^x$ is an exponential function, it must grow faster than $x^2$ starting at some point and notice that $g(4)=0, g(5)=7, g(6)=28$, $g(x)$ is strictly increasing when $x\ge 4$. Therefore, the extremal points must lie on the interval $[0,4]$ with their maximum value less than $4$. This implies that all points $x$ such that $g(x)$ is injective for $g(x)\ge 4$, so since $g(f(p))=g(p)\ge g(5)=7$ for all $p\ge 5$, we must have $f(p)=p$ for all primes greater than or equal to $5$. Hence, $\boxed{f(p)=p, \ \forall p\in \mathbb{P}}.$ $\textbf{Remark:}$ Perhaps $\textbf{Mihăilescu's theorem}$ is quite overkilled?
01.03.2021 01:24
dangerousliri wrote: 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 If $f(x)$ is constant for some two primes $x$ and $y$, then $P(x, y) \implies x^y = y^x$, a contradiction. Therefore, $f$ is injective over $\mathbb{P}$. Then we see that $P(2, k) \implies f(2)^{f(k)} + k^2 = f(k)^{f(2)} + 2^k$ implying that $f(2)$ is even and so $f(2) = 2$ since $f(2) \in \mathbb{P}$. Now, we see that $P(3, 2) \implies f(3)^2 - 2^{f(3)} = 1$ which by Mihailescu's Theorem (or Catalan Conjecture) we get that $f(3) = 3$ (there must be a better way rather than overkilling with a Theorem whose proof I certainly do not remember by the top of my head) Now, if $p$ is an odd prime, then $P(p, 3) \implies f(p)^3 + 3^p = 3^{f(p)} + p^3$. Now, since $f$ is injective, we have that $f(p) \geq 3$. So, we see that $f(p)^3- 3^{f(p)} = p^3 - 3^p$ and we see that for all $p \geq 5$, $(p + \epsilon)^3 - 3^{p + \epsilon} < p^3 - 3^p$ where $\epsilon \in \mathbb{N}$ simply because $3^p$ grows faster than $p^3$ and $3^5 > 5^3$, which means that for $(p + \epsilon)^3 - 3^{p + \epsilon} = p^3 - 3^p$ to be true, $\epsilon$ must be $0$, implying that $f(p) = p$ as desired.
01.03.2021 03:59
same stuff but meh. First, note that $f$ can not be constant. If we take any two odd distinct primes $p,q$ the assertion gives us that $f(p)$ and $f(q)$ must have the same parity. We can't have $f(p)=2$ for all odd $p$ else the assertion is false. Thus, $f(p)$ is odd for odd $p$. Now if we plug in $2$ and some odd $p$, we get that $f(2)$ and $f(p)$ are different parities, which forces $f(2)=2$. Now fix some prime $p$. Plugging in $2$ and $p$, we have \[2^{f(p)}+p^2=f(p)^2+2^p \iff 2^{f(p)}-f(p)^2=2^{p}-p^2\]It can easily be seen that for $x\geq 3$, $2^x-x^2$ is increasing, so this equality forces $f(p)=p$ for all odd $p$. Combining this with $f(2)=2$, our solution is $f(p)=p$.
22.04.2021 06:47
Let $P(p,q)$ be the assertion $f(p)^{f(q)}+q^p=f(q)^{f(p)}+p^q$. $\textbf{1. }f(2)=2$ If $\exists p>2:f(p)=2$, let $q$ be an odd prime. $P(p,q)\Rightarrow 2^{f(q)}+q^p=f(q)^2+p^q\overset{\pmod2}{=\joinrel=\joinrel\Longrightarrow}f(q)\equiv0\pmod2\Rightarrow f(q)=2$ But if we use odd primes in the original assertion, we get $p^q=q^p$, impossible. So $f$ takes odd primes to odd primes. $P(2,q)\Rightarrow f(2)^{f(q)}+q^2=f(q)^{f(2)}+2^q\overset{\pmod2}{=\joinrel=\joinrel\Longrightarrow}f(2)^{f(q)}\equiv0\pmod2\Rightarrow f(2)=2$ (alternatively, you can do $P(3,2)$ and then Mihailescu's) $\blacksquare$ $P(2,p)\Rightarrow 2^{f(p)}+p^2=f(p)^2+2^p$, and separating variables, we get $2^{f(p)}-f(p)^2=2^p-p^2$. Let the function $g:\mathbb P\to\mathbb P$ be defined by $g(x)=2^x-x^2$. $\textbf{2. }g$ is injective Checking the first few values, we have $g(2)=0$ and $g(3)=-1$. Then it suffices to show that $g$ is increasing for $x\ge5$, since $g(5)=7$. We have: $g(x+1)>g(x)\Leftrightarrow 2\cdot2^x-x^2-2x-1>2^x-x^2\Leftrightarrow 2^x-2x+1>0$ We now prove this by induction. Base case. This is $2^5-10+1>0$, which is true. Induction step. If $2^x-2x+1>0$ for some $x$, then $2\cdot2^x+2>4x=2x+2x\ge2x+10>2x+3$, which rearranges to $2^{x+1}-2(x+1)+1>0$. $\blacksquare$ Since $g$ is injective, we must have $\boxed{f(p)=p}$, which can easily be seen to work. $\square$
10.10.2021 00:07
I claim the answer is $\boxed{f(p)=p \text{ for } p\in\mathbb{P}}$. Let $Q(p,q)$ denote the given assertion. Let $k$ be an odd prime. $Q(2,k): f(2)^{f(k)}+k^2=f(k)^{f(2)}+2^k$. Note that $f(2)^{f(k)}$ and $f(k)^{f(2)}$ are powers of a prime, so exactly one of $\{f(2),f(k)\}$ must be $2$ because exactly one of them must be even. Suppose $f(k)=2$. Let $l$ be a prime that is greater than $k$. $Q(k,l): 2^{f(l)}+l^k=f(l)^2+k^l$, so $f(l)$ is even, which implies that $f(l)=2$. But this is a contradiction as $l^k\ne k^l$. So $f(2)=2$. Let $f(p)=r$. $Q(2,p): 2^r+p^2=r^2+2^p$. So $2^p-p^2=2^r-r^2$. It's easy to see that if $p$ and $r$ are both primes, then $p=r$ (because equality holds when $p=2$ and $r=4$, and $2^k-k^2$ forms a strictly increasing sequence after that).
11.10.2021 03:24
Let $P(p,q)$ the assertion of the given F.E. $P(3,2)$ $$f(3)^{f(2)}-f(2)^{f(3)}=1 \implies f(2)=2 \; \text{and} \; f(3)=3$$The last step holds by Catalans conjeture. $P(p,2)$ $$2^{f(p)}-f(p)^2=2^p-p^2$$Note that $h(x)=2^x-x^2$ is stricly increasing becuase $h'(x)=2^x \cdot \ln(2)-2x>2^{x-1}-2x$ thus we have to prove that $2^{x-2}>x$ which holds when $x \ge 5$ thus $f(p)=p$ when $p \ge 5$ but since $f(3)=3$ and $f(2)=2$ we have $f(p)=p$ for every prime $p$ and we are done
02.04.2022 17:03
Case 1:$f(2)\neq 2$. Then for any odd prime $p$, taking $P(p,2)$ mod $2$ implies that $f(p) = 2$. However, $P(3,5)$ leads to a contradiction. Case 2:$f(2) = 2$. Then $P(p,2)\implies 2^{f(p)} - f(p)^2 = 2^p - p^2$. With a bit of calculus, one can find that the function $g(x) = 2^x - x^2$ is increasing on the interval $[4,\infty)$. Since $2^3 - 3^2 < 2^4 - 4^2$, it follows that $g(x)$ is increasing on the integers on the interval $[3,\infty)$. By mod $2$, $f(p) = 2$ is not a solution to $2^{f(p)} - f(p)^2 = 2^p - p^2$. Hence, the only prime solution is $f(p) = p$, and the function $f(p)\equiv p$ is indeed a solution to the original FE.
24.07.2022 16:56
in my solution @imogold in telegram channel
29.08.2022 03:18
Same solutions as others but whatever Let $P(p,q)$ be the assertion of the given equation.Note that the function is injective. \begin{align*} &P(2,3): 1 = f(3)^{f(2)}-f(2)^{f(3)} \Rightarrow f(3)=3,f(2)=2 \ \text{By Catalan conjecture} \\ &P(2,q):2^{f(q)} + q^2=f(q)^2+2^q \Rightarrow 2^{f(q)}- f(q)^2=2^q-q^2 \end{align*}The function $2^x-x^2$ is increasing function in interval $[3, \infty]$ since $f'(x)= \ln (x) 2^x-2x \ge 0 \ \forall x \in [3,\infty]$ Therefore if $f(q) \neq q$ we have $ 2^{f(q)}- f(q)^2>2^q-q^2$ or $ 2^{f(q)}- f(q)^2<2^q-q^2 $. Hence either $f(q)=2$ or $f(q)=q$. Obviously, $f(q) \neq 2$ hence $f(q)=q$ $\blacksquare$
29.10.2022 20:46
The answer is only $f(x) = x$ for all $x\in\mathbb{P}$. This clearly works, so now we prove that it is the only solution. Take $p = 2$ and $q\in\mathbb{P}\setminus \{2\}$ to obtain $f(2)^{f(q)} + q^2 = f(q)^{f(2)} + 2^q$. Taking modulo $2$ on both sides gives $f(2)^{f(q)} +1\equiv f(q)^{f(2)}$, which implies exactly one of $f(2)^{f(q)}$ and $f(q)^{f(2)}$ is even and the other is even. Claim: $f(2)$ is even. Proof: FTSOC, suppose $f(2)^{f(q)}$ is odd. Then $f(q)^{f(2)}$ is always even, meaning $f(q)= 2$. Thus $f(2)^2+ q^2 = 2^{f(2)} + 2^q$ for all $q\in\mathbb{P}\setminus\{2\}$. Taking $q = 3$ gives $f(2)^2= 2^{f(2)} - 1$. We can manually check that this equation has no odd prime solutions if $f(2) < 5$, and the LHS is always greater than the RHS for $f(2)\ge 5$, so we have no solutions for $f(2)$, contradiction $\square$ Thus $f(2)^{f(q)}$ is even, so $f(2)=2$. Hence, $2^{f(q)} + q^2 = f(q)^2+ 2^q\implies 2^{f(q)} - f(q)^2= 2^q- q^2$ for all $q\in\mathbb{P}\setminus \{2\}$. Since $2^t - t^2$ is injective for $t \ge 5$ (since it is strictly increasing in this interval), we have $f(q) = q$. Hence, $f(x) = x$ for all $x\in\mathbb{P}$.
30.10.2022 02:22
the first time I saw this problem was when I met Mihăilescu's theorem, it is one of the most interesting ones I have seen
16.01.2023 22:24
dangerousliri wrote: 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 Let $P(p,q)$ be the assertion Now, from $P(2,3)$ $f(2)^{f(3)}+1=f(3)^{f(2)}$ if both $f(2)$ and $f(3)$ are odd prime. It will be a contradiction Assume that $f(3)=2$ Then equality becomes $f(2)^2+1=2^{f(2)}$ known that RHS is bigger than LHS for large values of $f(2)$ , Contradiction. So, $f(2)=2$ Now, we claim that if $p>q$ , $f(p)>f(q)$ First of all from $P(2,3)$ , $f(3)=3$, $f(3)>f(2)$ now take $p>q>2$ $P(p,q)$ gives that $f(q)^{f(p)}>f(p)^{f(q)}$ $f(q)^{1/f(q)}>f(p)^{1/f(p)}$ Notice that f is injective on point $(2,2)$ and $x^{1/x}$ is strictly increasing for $x>e$ We have proved the Claim. Now we will finish the problem with induction Assume that $p_1,p_2,...,p_k,$ are the first k prime numbers such that $f(p_i)=p_i$ for $i=1,2,...,k$ if we show that $f(p_{k+1})=p_{k+1}$ we are done. From f is strictly increasing we know that $f(p)\ge p$ now if $f(p_{k+1})-p_{k+1}>0$ from $P(p_k,p_{k+1})$ $${p_k }^{f(p_{k+1})}-{p_k }^{p_{k+1}}={f(p_{k+1})}^{p_k }-{p_{k+1}}^{p_k}$$from Fermat's theorem $p$ divides $f(p_{k+1})-p_{k+1}$ and now we can Lift the exponent in the equation $\nu_{p_k}(LHS)=\nu_{p_k}(p_k)+\nu_{p_k}(f(p_{k+1})-p_{k+1})$ that gives us $\nu_{p_k}(f(p_{k+1})-p_{k+1})={p_k}$ so $f(p_{k+1})\ge {p_k}^{{p_k}}+p_{k+1}$ and that's obvious contradiction from the equation: ${p_k }^{f(p_{k+1})}-{p_k }^{p_{k+1}}={f(p_{k+1})}^{p_k }-{p_{k+1}}^{p_k}$ So, we're done $f(p)=p$ for all prime $p$
29.04.2023 07:28
Please investigate if my solution has any loopholes (sorry, I am new to Olympiads). We attempt to show that f(p) = p (aka F(x) = x). Substitute p =2 in, we get f(2)^f(q) + q^2 = f(q)^f(2) + 2^q. To show F(x) = x means we have to show that f(2) = 2. We do this via a parity argument. Parity argument: If f(2) is NOT 2, then it will be odd. Thus the q^2 will be odd as well. Then f(q) must be 2 for all odd q (q = 2 is a pointless identity). But then, the initial identity does not hold at all for all p,q, since p^q = q^p is absurd for unequal primes. Thus f(2) = 2. Then 2^f(q) + q^2 = f(q)^2 + 2^q => 2^f(q) - f(q)^2 = 2^q - q^2. This is increasing if f(q) increases. So f(q) must be equal to q for this equation to be true. Thus, we have proved that f(x) is the identity function. Note: Can you say a function is increasing without proving it? The function here is obviously increasing but I want to know if further justification is needed.
24.01.2024 18:13
Let $P(x,y)$ be the assertion. First, we claim that for all odd primes $p$, $f(p) \neq 2$. Say there exists such a prime $p$. Plug in $P(p, q)$: $$2^f(q) + q^p = f(q)^2 + p^q$$Since the sides of the equation have different parities this is not possible. Now, we claim $f(2) = 2$. Plug in $P(p, 2)$: $$f(p)^f(2) + 2^p = f(2)^f(p) + p^2$$If $f(2)$ was odd, they would have different parities hence $f(2) = 2 \implies f(p)^2 + 2^p = 2^f(p) + p^2 \implies 2^p - p^2 = 2^f(p) - f(p)^2$. We claim that $h(x) = 2^x - x^2$ is strictly increasing via induction. This would mean that $2^{x+1} - 2^x - 2x - 1 > 0 \implies 2^x - 2x - 1 > 0$. Plugging in 3, it clearly works. Now say it's true for $\{3, 4, ..., k\}$. $$2^(k+1) > 4k + 2 \implies 4k + 2 - 2k - 2 - 1 = 2k - 1 > 0$$So our function is strictly increasing, which means that $f(p)$ must equal $p$.
21.05.2024 08:19
Let $P(x,y)$ denote the given assertion. Suppose for the sake of contradiction, that for all odd primes $p$, $f(p)$ is even, i.e $f(p) = 2$ It follows that $2^2 + p^q = 2^2 + q^p$ and hence $p^q = q^p$ which is a contradiction for distinct primes $q,p$. We conclude that there exist odd $p$ such that $f(p)$ is odd. Then $P(p,2)$ yields : $$f(2)^{f(p)} + p^2 = f(p)^{f(2)} + 2^p$$It follows that $f(2)$ is even, i.e $f(2) = 2$. We thus get $2^{f(p)} + p^2 = f(p)^{2} + 2^p$, rearranging this yields : $$2^{f(p)} - f(p)^{2} = 2^p - p^2 $$The function $g(x) = 2^x - x^2$ is bijective for $x \geq 5$ (Since $g'(x) = \ln(2)\times2^x - x^2 > 2^{x-1} - x^2 > 0$ for $x \geq 5$, with the fact that it is continuous) Hence we conclude that $f(p) = p$ for all primes $p \geq 5$. Now $P(3,2)$ yields : $f(3)^2 - 2^{f(3)} = 1$, i.e $(f(3) - 1)(f(3) + 1) = 2^{f(3)}$, thus two even consective integers are both powers of two, it follows that $f(3) - 1 = 2$ and $f(3) + 1= 4$, and thus that $f(3) = 3$ Hence we conclude that $f(p) = p$ for all $p \in \mathbb{P}$
21.05.2024 12:37
A rather different FE which you should be really careful with. Something tells me this is going to be the kind of problem where its easy to loose some points. The answers are $f(p)=p$ for all $p \in \mathbb{P}$. It’s easy to see that these functions satisfy the given equation. We now show these are the only solutions. We denote by $P(p,q)$ the assertion that $f(p)^{f(q)}+q^p=f(q)^{f(p)}+p^q$. We first prove the following property of $f$. Claim : The function $f$ is injective. Proof : Say there exists primes $p\neq q$ such that $f(p)=f(q)=r$. Then, \begin{align*} f(p)^{f(q)} + q^p &= f(q)^{f(p)}+p^q\\ r^r + q^p &= r^r + p^q\\ q^p &= p^q \end{align*}which is clearly impossible since $p$ and $q$ are distinct primes. Thus, our claim is proved. Now, note that since $f$ is injective, there must exist some odd prime $q$ for which $f(q)\neq 2$. Then, $P(2,q)$ gives, \[f(2)^{f(q)}+q^2 = f(q)^{f(2)}+2^q\]But, note that if $f(2)$ were odd, the right hand side would be even, while the left hand side is odd. This is a clear contradiction implying that $f(2)=2$. Now, $P(3,2)$ gives \begin{align*} f(2)^{f(3)} + 3^2 &= f(3)^{f(2)}+2^3\\ 2^{f(3)} &= f(3)^2-1\\ 2^{f(3)} &= (f(3)-1)(f(3)+1) \end{align*}But, this implies that $f(3)-1$ and $f(3)+1$ are both powers of two, which is only possible if $f(3)=3$. Now, we define the following function. Let $\phi : \mathbb{N} \to \mathbb{N}$ be the function such that $\phi(n)=2^n - n^2$ for all $n\in \mathbb{N}$. We prove the following property of $\phi$. Claim : The function $\phi$ is injective at all points except for $\phi(2)=\phi(4)$. Proof : We first show that $\phi(m)>\phi(n)$ for all pairs of natural numbers $m>n>3$. This is clear since, \[\phi(n+1)-\phi(n)=2^{n+1}-(n+1)^2 - 2^n + n^2 = 2^n -2n-1>0\]and $2^n > 2n+1$ for all natural numbers $n\geq 3$. So, $\phi$ is increasing beyond $\phi(3)$. Thus, if there exists a pair of natural numbers $m$ and $n$ such that $\phi(m)=\phi(n)$, we must have one of $m,n$ being $2$. Then, since $2^n-n^2=0=\phi(2)$ if and only if $n\in \{2,4\}$, the desired claim follows. But now, note that $P(2,p)$ gives us \[2^{f(p)}-f(p)^2 = 2^p - p^2\]But here, since $4$ is clearly not a prime, we must have $f(p)=p$ as a result of the previous claim, which implies that all solutions are indeed of the claimed forms.
21.06.2024 22:05
$f(2)^{f(3)}+3^2=f(3)^{f(2)}+2^3$ so $f(3)^{f(2)}-f(2)^{f(3)}=1$ so $f(2)=2$ and $f(3)=3$ by Catalan's Conjecture. $f(p)^2+2^p=2^{f(p)}+p^2$ so $2^p-p^2=2^{f(p)}-f(p)^2$ $2^2-2^2=0$ $2^3-3^2=-1$ $2^5-5^2=7$ $2^7-7^2=79$ we claim that $2^{n+1}-{n+1}^2>2^{n}-n^2$ for $n\ge 7$. this simplifies into $2^n>2n+1$, which is clearly true for $n\ge 7$ therefore, $\boxed{f(p)=p}$ and plugging it back in gives $p^q+q^p=q^p+p^q$ which is true
22.06.2024 21:24
We claim $\boxed{f(p)\equiv p}$. Claim. $f(2)=2$ and $f(p)$ is odd if $p$ is odd. Proof. Let $p$ be an odd prime. Then $f(p)^{f(2)}+2^p=f(2)^{f(p)}+p^2$ so $f(2)$ and $f(p)$ have opposite parity. Assume FTSOC $f(2)$ is odd. Then $f(p)=2$ for all $p>2$. However, this means that $2^{f(2)}+2^p=f(2)^2+p^2$ for all primes $p$. Taking $p$ arbitrarily large yields a contradiction. The conclusion follows. $\square$ Now $f(p)^2+2^p=2^{f(p)}+p^2$. For $x>4$, the function $g:x\mapsto 2^x-x^2$ is increasing and positive. For $2<x<4$, $g$ is negative. Hence $g$ is injective on odd primes so $f(p)=p$ for $p>2$, as desired. $\square$
29.06.2024 03:48
The only solution is $f(p)=p$ for all primes $p$. It is obvious this solution works, so we show it is the only one. Claim: $f$ is injective. Proof: Suppose the contrary, that there exist distinct primes $p$ and $q$ such that $f(p)=f(q)$. Then, we must have $p^q=q^p$, absurd. Claim: $f(2)=2$ and $f(3)=3$. Proof: Let $q=2$, $p>2$, and the given relation becomes $f(p)^{f(2)} + 2^p = f(2)^{f(p)} + p^2$. Hence, $f(2)$ and $f(p)$ have opposite parities, and either $f(2)=2$ or $f(p)=2$ for all $p>2$. Since $f$ is injective, we must have $f(2)=2$. Claim: $f$ is the identity function. Proof: Let $q=2$, and $p>2$. For the sake of contradiction, suppose $f(p)\ne p$. We have $2^p- p^2=2^{f(p)} - f(p)^2$. Since $\tfrac{d}{dp}(2^p-p^2) = 2^p\log 2 - 2p$ is positive for $p>3$, if $p,f(p)>3$, then $f(p)=p$, contradiction. On the other hand, if WLOG $f(p)=3$, we have $2^p - p^2 = -1$. Rearranging, this is equivalent to $(p-1)(p+1)=2^p$, and since $\gcd(p-1,p+1)=2$, we must have $p-1=2$, implying $p=3$. Hence, we are done. $\blacksquare$
14.12.2024 10:37
Let $P(p,q)$ denote the assertion $f(p)^{f(q)}+q^p=f(q)^{f(p)}+p^q$. Letting $p\neq q$ and $f(p)=f(q)=r$ we get $p^q=q^p\implies p=q\implies f$ is injective. $P(p,2)\implies f(p)^{f(2)}+2^p=f(2)^{f(p)}+p^2$, if we assume the contrary that $f(2)\neq 2$ then $f(p)=2, p\geq 3$ if $p,q$ are both odd then we get $p^q=q^p\implies p=q\implies f(2)=2$. $P(2,3)\implies f(2)^{f(3)}+3^2=f(3)^{f(2)}+2^3$, since $f(2)=2$ is established we get $f(3)=3$ (this can also be checked through Catalan's Conjecture). $P(2,q)\implies 2^{f(q)}-f(q)^2=2^q-q^2$. Letting $g(x)=2^x-x^2$, we have $g'(x)>0,\forall x\in [5,\infty]$ so $f(q)=q, q\geq 5$, so $\boxed{f(p)=p\forall p\in \mathbb{P}}$
14.12.2024 15:18
14.12.2024 15:22
Main claims: $f(2) = 2$ $g(x) = 2^x - x^2 is injective over \mathbb{P}$. This should be enough iirc to get $f \equiv id$.
11.01.2025 23:15
sketch