{ "problem": "For given positive integers $x$ and $y$, we define a sequence $(a_n)_{n \\ge 1}$ as\n $$\n a_n = \\gcd \\left( x^n +y , \\, (y-x)\\left(\\sum_{i=0}^{n-1} y^i x^{n-i-1} - 1\\right) \\right)\n $$\n for all $n\\in \\mathbb{N}$. Find all pairs $(x,y)$ of positive integers such that the limit of the sequence $(a_n)$ exists.", "solution": "To begin with, we can change the expression in the problem to\n $\\gcd \\left( x^n +y , \\, (y-x)\\left(\\sum_{i=0}^{n-1} y^i x^{n-i-1} - 1\\right) \\right) = \\gcd \\left( x^n +y , \\, y^n - x^n -(y-x) \\right) = \\gcd(x^n +y , y^n +x)$.\n Let the limit of the sequence $(a_n)$ exist and be equal to $g$. Then, for sufficiently large $n$,\n\n Lemma. If the limit of $a_n$ as $n \\to \\infty$ exists and is equal to $g$, then $g$ divides $2 \\gcd(x, y)$.\n\n Proof. For sufficiently large $n$, we have $a_n = \\gcd \\left( x^n +y , \\, y^n +x \\right) = g$.\n This implies that $g$ divides $x^n + y$ and $g$ divides $y^n +x$ for all $n \\ge N$, for some positive integer $N$.\n\n Consider $n \\ge N$. We have $x^n + y \\equiv 0 \\pmod{g}$ and $x^{n+1} + y \\equiv 0 \\pmod{g}$.\n Multiplying the first congruence by $x$, we get $x^{n+1} + xy \\equiv 0 \\pmod{g}$.\n Subtracting the second congruence from this, we have $(x^{n+1} + xy) - (x^{n+1} + y) \\equiv 0 - 0 \\pmod{g}$, which simplifies to $xy - y = y(x-1) \\equiv 0 \\pmod{g}$.\n\n Analogously, $x(y-1)$ is divisible by $g$.\n Their difference $x-y$ is then divisible by $g$, so $g$ also divides\n $x(y-1)+x(x-y)=x^2 -x$. All powers of $x$ are then congruent modulo\n $g$, so $x+y\\equiv x^{N}+y\\equiv0(\\bmod g)$. Then $2x=(x+y)+(x-y)$\n and $2y=(x+y)-(x-y)$ are both divisible by $g$, so $g\\mid2\\operatorname{gcd}(x,y)$.\n On the other hand, it is clear that $\\operatorname{gcd}(x,y)\\mid g$,\n thus proving the Lemma.\n\n Let $d=\\operatorname{gcd}(x,y)$, and write $x=da$ and $y=db$ for\n coprime positive integers $a$ and $b$. We have that\n\n \\[\n \\operatorname{gcd}\\left((da)^{n}+db,(db)^{n}+da\\right)=d\\operatorname{gcd}\\left(d^{n-1}a^{n}+b,d^{n-1}b^{n}+a\\right)\n \\]\n\n so the Lemma tells us that\n\n \\[\n \\operatorname{gcd}\\left(d^{n-1}a^{n}+b,d^{n-1}b^{n}+a\\right)\\leqslant2\n \\]\n\n for all $n\\geqslant N$. Defining $K=d^{2}ab+1$, note that $K$ is\n coprime to each of $d,a$, and $b$. By Euler's theorem, for $n\\equiv-1(\\bmod\\varphi(K))$\n we have that\n\n \\[\n d^{n-1}a^{n}+b\\equiv d^{-2}a^{-1}+b\\equiv d^{-2}a^{-1}\\left(1+d^{2}ab\\right)\\equiv 0\\quad(\\bmod K)\n \\]\n\n so $K\\mid d^{n-1}a^{n}+b$. Analogously, we have that $K\\mid d^{n-1}b^{n}+a$.\n Taking such an $n$ which also satisfies $n\\geqslant N$ gives us\n that\n\n \\[\n K\\mid\\operatorname{gcd}\\left(d^{n-1}a^{n}+b,d^{n-1}b^{n}+a\\right)\\leqslant2\n \\]\n\n This is only possible when $d=a=b=1$, which yields the only solution\n $(x,y)=(1,1)$. Therefore, the only solution is $(x,y)=(1,1)$.", "grading_guidelines": "(Partial)\n 1. Considered a prime $p|xy+1$.\n(Almost)\n 1. Solution is almost complete, but made minor mistakes which are not negligible.\n 2. Omitted the case when $xy+1$ doesn't have an odd prime factor.", "problem_id": "PB-Advanced-020", "level": "advanced", "category": "Number theory", "source": "(Modified) IMO 2024 P2", "max_score": 7, "difficulty": "IMO-medium", "short_answer": "(1,1)" }