Problem

Source: Iran MO 2023 3rd round , Algebra exam P3

Tags: algebra, polynomial



For numbers $a,b \in \mathbb{R}$ we consider the sets: $$A=\{a^n | n \in \mathbb{N}\} , B=\{b^n | n \in \mathbb{N}\}$$Find all $a,b > 1$ for which there exists two real , non-constant polynomials $P,Q$ with positive leading coefficients st for each $r \in \mathbb{R}$: $$ P(r) \in A \iff Q(r) \in B$$