{"year": "2022", "tier": "T2", "problem_label": "1", "problem_type": null, "exam": "EGMO", "problem": "Let $A B C$ be an acute-angled triangle in which $B Cq$, and let $p^{t}=a q+b$ with $0 \\leq bp^{t-1}$, so $a1$ and $f(q)>1$, and these are the two smallest such primes.\n$11$ and $f(q)>1$ are equal, so $f(q)=f(p)=a$.\n\nIf $p^{2}1$ for some $m \\in \\mathbb{N}$, then there are less than $m$ different prime numbers $p_{i}$ with $f\\left(p_{i}\\right)>1$.\nProof. On the one hand, if $f(m)=c>1$, then for any $n \\in \\mathbb{N}$, there is some $k \\in\\{n+1, n+2 \\ldots, n+m\\}$ such that $f(k) \\in\\{1, c\\}$. To show this, it is enough to see that condition (2) implies that for any $n \\in \\mathbb{N}$\n\n- if $f(n)=c$, then $f(n+1) \\in\\{1, c\\}$;\n- if $f(n)=1$, then $f(n+m) \\in\\{1, c\\}$.\n\nOn the other hand, if we suppose that there are $m$ different prime numbers $p_{1}, p_{2}, \\ldots, p_{m}$, then we know (by the Chinese Remainder Theorem) that for any number $t \\in \\mathbb{N}$, there exists a number $n_{t} \\in \\mathbb{N}$ such that $p_{k}^{t} \\mid n_{t}+k$ for each $k \\in\\{1,2, \\ldots, m\\}$. Hence for each $k$, we have\n\n$$\nf\\left(n_{t}+k\\right) \\geq f\\left(p_{i}^{t}\\right)=f\\left(p_{i}\\right)^{t} \\geq 2^{t} .\n$$\n\nIf $2^{t}>c$, then it means that $f(k)>c$ for all $k \\in\\left\\{n_{t}+1, n_{t}+2 \\ldots, n_{t}+m\\right\\}$.\nNow we can suppose that for some $m \\geq 2$, the set of primes with $f(p)>1$ is $S=\\left\\{p_{1}, p_{2}, \\ldots, p_{m}\\right\\}$. Now let $S_{1}$ and $S_{2}$ be two disjoint nonempty subsets such that $S_{1} \\cup S_{2}=S$. Let $a=\\prod_{p_{i} \\in S_{1}} p_{i}$ and $b=\\prod_{p_{j} \\in S_{2}} p_{j}$.\n\nNow for any $k, \\ell \\in \\mathbb{N}, a^{k}+b^{\\ell}$ is coprime to all primes in $S$, hence $f\\left(a^{k}+b^{\\ell}\\right)=1$. It is easy to see that we can choose $k$ and $\\ell$ such that $f\\left(a^{k}\\right) \\neq f\\left(b^{\\ell}\\right)$, which contradicts condition (2).", "metadata": {"resource_path": "EGMO/segmented/en-2022-solutions.jsonl", "problem_match": "# Problem 2.", "solution_match": "# Solution 3 (Joseph Myers) "}} {"year": "2022", "tier": "T2", "problem_label": "2", "problem_type": null, "exam": "EGMO", "problem": "Let $\\mathbb{N}=\\{1,2,3, \\ldots\\}$ be the set of all positive integers. Find all functions $f: \\mathbb{N} \\rightarrow \\mathbb{N}$ such that for any positive integers $a$ and $b$, the following two conditions hold:\n(1) $f(a b)=f(a) f(b)$, and\n(2) at least two of the numbers $f(a), f(b)$ and $f(a+b)$ are equal.\n\nProposed by: Fedir Yudin, Ukraine\nAnswer: $f(n)=a^{v_{p}(n)}$, where $a \\in \\mathbb{N}, p$ is a prime and $v_{p}(n)$ is the largest exponent of $p$ dividing $n$.", "solution": "Let $p$ the minimal (prime) number with $f(p)=c>1$.\nClaim 4.1. For any $k \\in \\mathbb{N}, f\\left(1+p+p^{2}+\\ldots+p^{k}\\right) \\in\\left\\{1, c, c^{2}, \\ldots, c^{k}\\right\\}$.\nProof of the claim. Use condition (2) recursively.\nNow suppose that there exists some prime $q>p$ with $f(q)>1$, and consider the following three values of $f$ :\n\n- $f(1)=1$.\n- $f\\left(p^{q-1}-1\\right)=f(p-1) f\\left(p^{q-2}+p^{q-3}+\\ldots+p+1\\right) \\in\\left\\{1, c, c^{2}, \\ldots, c^{q-2}\\right\\}$ using our claim, (note that we know $f(p-1)=1$ by the minimality of $p$ ).\nBut we also know (by Fermat's little theorem) that $q \\mid p^{q-1}-1$, hence $f(q) \\mid f\\left(p^{q-1}-1\\right)$. Therefore we have that: $f\\left(p^{q-1}-1\\right) \\in\\left\\{c, c^{2}, \\ldots, c^{q-2}\\right\\}$.\n- $f\\left(p^{q-1}\\right)=c^{q-1}$.\n\nThese are three different values, hence we have a contradiction by condition (2).", "metadata": {"resource_path": "EGMO/segmented/en-2022-solutions.jsonl", "problem_match": "# Problem 2.", "solution_match": "\nSolution 4 (for the main part)."}} {"year": "2022", "tier": "T2", "problem_label": "2", "problem_type": null, "exam": "EGMO", "problem": "Let $\\mathbb{N}=\\{1,2,3, \\ldots\\}$ be the set of all positive integers. Find all functions $f: \\mathbb{N} \\rightarrow \\mathbb{N}$ such that for any positive integers $a$ and $b$, the following two conditions hold:\n(1) $f(a b)=f(a) f(b)$, and\n(2) at least two of the numbers $f(a), f(b)$ and $f(a+b)$ are equal.\n\nProposed by: Fedir Yudin, Ukraine\nAnswer: $f(n)=a^{v_{p}(n)}$, where $a \\in \\mathbb{N}, p$ is a prime and $v_{p}(n)$ is the largest exponent of $p$ dividing $n$.", "solution": "4B (for the main part). Let $p$ the minimal (prime) number with $f(p)=c>1$.\nLemma 4B.1. For any $k \\in \\mathbb{N}, f\\left(1+p+p^{2}+\\ldots+p^{k}\\right)=1$.\nProof of the Lemma, by induction. $k=0$ is trivial.\n$k=1$ is also easy, as $p+1$ cannot be a prime, except in the case of $p=2$, which is also easy. (If $f(2)=c>1$, then $f(3) \\in\\{1, c\\}$ by $3=1+2$ and $f(3) \\in\\left\\{1, c^{2}\\right\\}$ by $2^{2}=1+3$.)\n\nFrom now we suppose $k \\geq 2$ and $f\\left(1+p+\\ldots+p^{k-1}\\right)=1$. By condition (2), we have that:\n\n- As $f\\left(1+p+\\ldots+p^{k-1}\\right)=1$ and $f\\left(p^{k}\\right)=c^{k}$, we have that $f\\left(1+p+\\ldots+p^{k-1}\\right) \\in\\left\\{1, c^{k}\\right\\}$\n- As $f(1)=1$ and $f\\left(p+\\ldots+p^{k}\\right)=f(p) f\\left(1+p+\\ldots+p^{k-1}\\right)=c$, we also have that $f\\left(1+p+\\ldots+p^{k-1}\\right) \\in\\{1, c\\}$.\nIf $k>1, c \\neq c^{k}$, therefore $f\\left(1+p+\\ldots+p^{k}\\right)=1$.\n\nNow suppose that there exists some prime $q>p$ with $f(q)>1$. Then by condition (1),\n\n$$\nf\\left(p^{q-1}-1\\right)=f(p-1) f\\left(1+p+\\ldots+p^{q-2}\\right)\n$$\n\nhere $f(p-1)=1$ (by the minimality of $p$ ) and $f\\left(1+p+\\ldots+p^{q-2}\\right)=1$ by the lemma. But we also know (by Fermat's little theorem) that $q \\mid p^{q-1}-1$, hence $1m \\in \\mathbb{N}$ ).\nProof of the Lemma. By condition (2), $\\{f(n+m), f(n-m)\\} \\subseteq\\{f(n), f(m)\\}$. We also have that:\n\n$$\nf(n-m) f(n+m)=f\\left(n^{2}-m^{2}\\right) \\in\\left\\{f(n)^{2}, f(m)^{2}\\right\\}\n$$\n\nwhich is only possible if $f(n-m)=f(n+m)=f(n)$ or $f(n-m)=f(n+m)=f(m)$.\nNow let $p$ be the smallest (prime) number with $f(p)>1$.\nClaim 5.2. If $p$ does not divide $n$, then $f(n)=1$.\nProof of the Claim. Let $n$ be the minimal counterexample, and and let $n=d p+r$ with $0b_{n-1}=c_{n-1}-c_{n-2}\n$$\n\nFactoring,\n\n$$\n\\left(m_{n}-m_{n-1}\\right)\\left(m_{n}+m_{n-1}\\right)>\\left(m_{n-1}-m_{n-2}\\right)\\left(m_{n-1}+m_{n-2}\\right)\n$$\n\nIn the case that $m_{n}-m_{n-1}=m_{n-1}-m_{n-2}$, this inequality clearly holds, as $m_{n}+m_{n-1}>m_{n-1}+m_{n-2}$. Thus, the minimal possible value of $m_{n}$ satisfies the claimed inequality.\n\nProof 2. Denote $c_{n-1}=x^{2}, c_{n-2}=(x-d)^{2}$. Then\n\n$$\n2 c_{n-1}-c_{n-2}=2 x^{2}-(x-d)^{2}=x^{2}+2 d x-d^{2}=(x+d)^{2}-2 d^{2}<(x+d)^{2}\n$$\n\nIt follows that $c_{n} \\leq(x+d)^{2}$.\nAnd so the sequence of positive integers $\\sqrt{c_{n}}-\\sqrt{c_{n-1}}$ is decreasing. Any such sequence is eventually constant.\n\nAs a corollary, $c_{n}=(x+n d)^{2}$ for sufficiently large $n$, with fixed integers $x$ and $d$. Along the lines above, it becomes clear that $a_{n}=c_{n}-2 c_{n-1}+c_{n-2}=2 d^{2}$, so the sequence $\\left(a_{n}\\right)$ is constant.", "metadata": {"resource_path": "EGMO/segmented/en-2022-solutions.jsonl", "problem_match": "# Problem 3.", "solution_match": "\nSolution."}} {"year": "2022", "tier": "T2", "problem_label": "3", "problem_type": null, "exam": "EGMO", "problem": "An infinite sequence of positive integers $a_{1}, a_{2}, \\ldots$ is called good if\n(1) $a_{1}$ is a perfect square, and\n(2) for any integer $n \\geq 2, a_{n}$ is the smallest positive integer such that\n\n$$\nn a_{1}+(n-1) a_{2}+\\ldots+2 a_{n-1}+a_{n}\n$$\n\nis a perfect square.\nProve that for any good sequence $a_{1}, a_{2}, \\ldots$, there exists a positive integer $k$ such that $a_{n}=a_{k}$ for all integers $n \\geq k$.\n\nProposed by: Joe Benton and Dominic Yeo, United Kingdom", "solution": "We write:\n\n$$\ns_{n}^{2}=S_{n}=a_{1}+\\left(a_{1}+a_{2}\\right)+\\ldots+\\left(a_{1}+\\ldots+a_{n}\\right)\n$$\n\nSo, setting $b_{n}:=a_{1}+\\ldots+a_{n}$, we have $S_{n}=b_{1}+b_{2}+\\ldots+b_{n}$ and, in particular $S_{n+1}=S_{n}+b_{n+1}$. Now, we study the quantity $S_{n} b_{n}=+b_{1}+b_{2}+\\ldots+b_{n}+b_{n}$ in two different ways. Since $b_{n+1}$ is the smallest integer strictly greater than $b_{n}$ such that $b_{1}+\\ldots+b_{n}+b_{n+1}$ is a perfect square, we must have\n\n$$\nb_{1}+b_{2}+\\ldots+b_{n}+b_{n} \\geq\\left(s_{n+1}-1\\right)^{2}\n$$\n\nHowever, we also have\n\n$$\nb_{1}+b_{2}+\\ldots+b_{n}+b_{n}=S_{n}+b_{n}=2 S_{n}-S_{n-1}\n$$\n\nCombining, we obtain\n\n$$\ns_{n}^{2} \\geq \\frac{s_{n-1}^{2}+\\left(s_{n+1}-1\\right)^{2}}{2}>\\left(\\frac{s_{n-1}+s_{n+1}-1}{2}\\right)^{2}\n$$\n\nwhere the final inequality is strict since the sequence $\\left(s_{k}\\right)$ is strictly increasing. Taking a square root, and noting that all the $\\left(s_{n}\\right)$ are integers, one obtains $s_{n+1}-s_{n} \\leq s_{n}-s_{n-1}$.\nNow we focus on the sequence $d_{n}=s_{n+1}-s_{n} .\\left(s_{k}\\right)$ is strictly increasing thus $\\left(d_{k}\\right)$ is positive. However we proved that $d_{n+1} \\leq d_{n}$, so the sequence $\\left(d_{k}\\right)$ is eventually constant, so eventually $s_{n}=b n+c$ and $S_{n}=(b n+c)^{2}$ with some numbers $b, c$; then\n\n$$\na_{n+2}=S_{n+2}-2 S_{n+1}+S_{n}=(b(n+2)+c)^{2}-2(b(n+1)+c)^{2}+(b n+c)^{2}=2 b^{2}\n$$\n\nRemark. The key idea is to use the $D$ difference operator on the space of sequences. That is a function which takes a sequence as an input and outputs another sequence the following way: if $(x)$ is the input sequence, then\n\n$$\nD(x)=D\\left(\\left(x_{1}, x_{2}, x_{3}, x_{4}, \\ldots\\right)\\right)=\\left(x_{2}-x_{1}, x_{3}-x_{2}, x_{4}-x_{3}, \\ldots\\right)\n$$\n\nHere $D D(S)=(a)$ (with some shift), $D(s)=(d)$. This $D$ operator has some nice properties; if someone studied calculus, these properties will be familiar. $D(x+y)=D(x)+D(y) ; D(\\lambda x)=\\lambda D(x) ;(x)$ constant iff $D x$ zero ; $(x)$ is linear iff $D x$ constant ; in general $(x)$ is a polynomial with degree $l+1$ iff $D(x)$ is a polynomial with degree $l$.\n\nFirst we proved that sequence $(d)$ is eventually constant, thus $D(d)=D D(s)$ is eventually zero. Therefore the sequence $(s)$ is eventually a linear function, hence $s^{2}=S$ is eventually a quadratic polynomial, therefore $0=D D D(S)=D(a)$, so $(a)$ is constant eventually.", "metadata": {"resource_path": "EGMO/segmented/en-2022-solutions.jsonl", "problem_match": "# Problem 3.", "solution_match": "\nSolution."}} {"year": "2022", "tier": "T2", "problem_label": "4", "problem_type": null, "exam": "EGMO", "problem": "Given a positive integer $n \\geq 2$, determine the largest positive integer $N$ for which there exist $N+1$ real numbers $a_{0}, a_{1}, \\ldots, a_{N}$ such that\n(1) $a_{0}+a_{1}=-\\frac{1}{n}$, and\n(2) $\\left(a_{k}+a_{k-1}\\right)\\left(a_{k}+a_{k+1}\\right)=a_{k-1}-a_{k+1}$ for $1 \\leq k \\leq N-1$.\n\nProposed by: Romania", "solution": "$\\left(a_{k}+a_{k-1}\\right)\\left(a_{k}+a_{k+1}\\right)=a_{k-1}-a_{k+1}$ is equivalent to $\\left(a_{k}+a_{k-1}+1\\right)\\left(a_{k}+a_{k+1}-1\\right)=-1$. Let $b_{k}=a_{k}+a_{k+1}$. Thus we need $b_{0}, b_{1}, \\ldots$ the following way: $b_{0}=-\\frac{1}{n}$ and $\\left(b_{k-1}+1\\right)\\left(b_{k}-1\\right)=-1$. There is a proper sequence $b_{0}, b_{1}, \\ldots, b_{N-1}$ if and only if there is proper sequence $a_{0}, a_{1}, \\ldots, a_{N}$, because from a a proper $\\left(a_{k}\\right)$ sequence we can get a proper $\\left(b_{k}\\right)$ sequence with $b_{k}=a_{k}+a_{k+1}$ for $k=0,1, \\ldots, N-1$ and from a proper $\\left(b_{k}\\right)$ sequence we can get a proper $\\left(a_{k}\\right)$ sequence by arbitrarily setting $a_{0}$ and then inductively defining $a_{k}=b_{k-1}-a_{k-1}$ for $k=1,2, \\ldots, N$.\n\nWe prove by induction that $b_{k}=-\\frac{1}{n-k}$ for $k