Cheeeeeeeeky commited on
Commit
730b2c2
·
verified ·
1 Parent(s): 72fa27c

upload model

Browse files
assets/olympiad_cases/CMO2025.jsonl ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ {"question": "Define two subsets $A$, $B$ of the set of complex numbers $\\Bbb C$ as follows:\\[ \\begin{aligned} A &= \\left\\{ z \\in \\Bbb C \\, \\left| \\, z = r \\textup{e}^{\\textup{i}\\theta} , \\, r \\geqslant 0, \\, \\theta \\in \\left[ 0, \\frac{\\pi}{41}\\right]\\right.\\right\\}, \\ B &= \\left\\{ z \\in \\Bbb C \\, \\left| \\, z = x + \\textup{i}y, \\, x,y \\in \\Bbb R , \\, \\left| x - y \\right| < 2025 \\right. \\right\\} \\end{aligned}\\]where $\\textup{i}$ is the imaginary unit and $r \\textup{e}^{\\textup{i}\\theta} = r \\left( \\cos \\theta + \\textup{i} \\sin \\theta \\right)$.\nFind all univariate polynomials of complex coefficients $P(x)$, such that for all $z \\in A$, we have $P(z) \\in B$. (Note: A monomial is also considered a polynomial.)", "problem_idx": "CMO2025-1", "model_prediction": {"proof": "We determine all polynomials \\(P(x)\\) with complex coefficients such that \n\\[\n\\forall z \\in A \\; : \\; P(z) \\in B,\n\\] \nwhere \n\\[\nA = \\bigl\\{z = r e^{\\mathrm{i}\\theta}\\;\\big|\\; r\\ge 0,\\; \\theta\\in[0,\\tfrac{\\pi}{41}]\\bigr\\}, \\qquad \nB = \\bigl\\{z = x+\\mathrm{i} y \\;\\big|\\; x,y\\in\\mathbb R,\\; |x-y|<2025\\bigr\\}.\n\\]\n\n---\n\n### 1. Constant polynomials\n\nIf \\(P\\) is constant, say \\(P(z)=c\\) for all \\(z\\), then the condition reduces to \\(c\\in B\\), i.e. \n\\[\n|\\operatorname{Re}(c)-\\operatorname{Im}(c)|<2025.\n\\] \nAll such constants clearly satisfy the requirement.\n\n---\n\n### 2. Non\u2011constant polynomials cannot work\n\nAssume, for contradiction, that a non\u2011constant polynomial \\(P\\) satisfies the condition. \nLet \\(\\deg P = n \\ge 1\\) and write \n\\[\nP(z)=a_n z^n + Q(z), \\qquad a_n\\neq 0,\n\\] \nwhere \\(Q\\) is a polynomial of degree at most \\(n-1\\).\n\nFor \\(z\\in A\\) we write \\(z = r e^{\\mathrm{i}\\theta}\\) with \\(r\\ge0\\) and \\(\\theta\\in[0,\\pi/41]\\). \nDefine the real\u2011valued function \n\\[\nF(z)=\\operatorname{Re}\\bigl(P(z)\\bigr)-\\operatorname{Im}\\bigl(P(z)\\bigr).\n\\] \nThe condition becomes \\(|F(z)|<2025\\) for every \\(z\\in A\\).\n\nSubstituting the expression of \\(P\\), \n\\[\nF(z)=\\operatorname{Re}(a_n z^n)-\\operatorname{Im}(a_n z^n) + \\bigl(\\operatorname{Re}(Q(z))-\\operatorname{Im}(Q(z))\\bigr).\n\\] \nBecause \\(\\deg Q\\le n-1\\), there exists a constant \\(C>0\\) such that for all \\(r\\ge1\\) and all \\(\\theta\\) \n\\[\n\\bigl|\\operatorname{Re}(Q(z))-\\operatorname{Im}(Q(z))\\bigr|\\le C\\, r^{n-1}.\n\\]\n\nWrite \\(a_n = |a_n| e^{\\mathrm{i}\\gamma}\\). Then \n\\[\na_n z^n = |a_n|\\, r^n e^{\\mathrm{i}(\\gamma+n\\theta)},\n\\] \nand therefore \n\\[\n\\operatorname{Re}(a_n z^n)-\\operatorname{Im}(a_n z^n)\n = |a_n|\\, r^n \\bigl(\\cos(\\gamma+n\\theta)-\\sin(\\gamma+n\\theta)\\bigr).\n\\] \nDenote \n\\[\ng(\\theta)=\\cos(\\gamma+n\\theta)-\\sin(\\gamma+n\\theta).\n\\]\n\nFor a fixed \\(\\theta_0\\in[0,\\pi/41]\\), as \\(r\\to\\infty\\) we have \n\\[\nF(r e^{\\mathrm{i}\\theta_0}) = |a_n|\\, r^n\\, g(\\theta_0) + O(r^{n-1}).\n\\]\n\nIf \\(g(\\theta_0)\\neq 0\\), then the term \\(|a_n|\\, r^n |g(\\theta_0)|\\) dominates the \\(O(r^{n-1})\\) term, so for sufficiently large \\(r\\) we obtain \n\\(|F(r e^{\\mathrm{i}\\theta_0})|>2025\\), contradicting the hypothesis. \nConsequently we must have \n\\[\ng(\\theta)=0 \\qquad\\text{for every } \\theta\\in[0,\\pi/41]. \\tag{1}\n\\]\n\nNow \\(g(\\theta)\\) is a real\u2011analytic (in fact, trigonometric) function of \\(\\theta\\). \nIf it vanishes on an interval, the identity theorem for analytic functions forces it to vanish identically on \\(\\mathbb R\\): \n\\[\n\\cos(\\gamma+n\\theta)=\\sin(\\gamma+n\\theta)\\quad \\forall\\,\\theta\\in\\mathbb R. \\tag{2}\n\\]\n\nWe show that (2) is impossible when \\(n\\ge 1\\). \nIndeed, taking \\(\\theta=0\\) gives \\(\\cos\\gamma=\\sin\\gamma\\). \nTaking \\(\\theta=\\frac{\\pi}{2n}\\) (which is allowed because (2) holds for all real \\(\\theta\\)) gives \n\\[\n\\cos\\Bigl(\\gamma+\\frac{\\pi}{2}\\Bigr)=\\sin\\Bigl(\\gamma+\\frac{\\pi}{2}\\Bigr)\n\\quad\\Longrightarrow\\quad -\\sin\\gamma = \\cos\\gamma.\n\\] \nTogether with \\(\\cos\\gamma=\\sin\\gamma\\) this yields \\(\\sin\\gamma=-\\sin\\gamma\\), hence \\(\\sin\\gamma=0\\), and then also \\(\\cos\\gamma=0\\). \nBut \\(\\cos\\gamma\\) and \\(\\sin\\gamma\\) cannot both be zero. This contradiction shows that \\(n\\) cannot be positive.\n\nTherefore our assumption \\(n\\ge1\\) is false, and any polynomial satisfying the condition must be constant.\n\n---\n\n### 3. Conclusion\n\nThe only polynomials \\(P(x)\\) with complex coefficients such that \\(P(z)\\in B\\) for all \\(z\\in A\\) are the constant polynomials whose value lies in \\(B\\):\n\\[\n\\boxed{\\bigl\\{\\, P(x)=c \\;\\big|\\; c\\in\\mathbb C,\\; |\\operatorname{Re}(c)-\\operatorname{Im}(c)|<2025 \\,\\bigr\\}}.\n\\]\n\n---", "average_automatic_rating": 1.0, "human_rating": 18}}
2
+ {"question": "Let $ABCD$ be an convex quadrilateral inscribed in a circle with center $O$ and radius $1$, with vertices labeled consecutively around the circle (regardless of orientation), which satisfies $\\angle ABC < \\angle BCD < 90^\\circ$. Let lines $BA$ and $CD$ intersect at $P$, diagonals $AC$ and $BD$ intersect at $Q$. There is a point $K$ on segment $\\overline{BC}$, such that $P$, $A$, $K$, $D$ are concyclic and $KB \\cdot KC = \\frac 12 OP^2$. The perpendicular to $BC$ through $Q$ intersects line $OP$ at $T$.\n(1) Find all possible values of $\\overline{OP}$.\n(2) Find all possible values of $\\overline{TB} + \\overline{TC}$.", "problem_idx": "CMO2025-2", "model_prediction": {"proof": "We solve the problem using a convenient coordinate system. \n\n---\n\n### 1. Coordinates and parameters \n\nPlace the circumcircle \\(\\Gamma\\) with centre \\(O=(0,0)\\) and radius \\(1\\). \nRotate the figure so that chord \\(BC\\) is vertical and symmetric about the \\(x\\)-axis. \nWrite \n\n\\[\nB = (a,\\;b),\\qquad C = (a,\\;-b),\n\\] \n\nwhere \\(a = \\cos\\beta>0,\\; b = \\sin\\beta>0\\) and \\(a^2+b^2=1\\). \n\nLet \\(K\\) be on segment \\(BC\\) and set \n\n\\[\ns = \\frac{BK}{BC}\\in(0,1).\n\\] \n\nSince \\(B\\) has \\(y=b\\), \\(C\\) has \\(y=-b\\), the coordinate of \\(K\\) is \n\n\\[\nK = (a,\\;b(1-2s)).\n\\] \n\nThen \n\n\\[\nKB = 2s b,\\qquad KC = 2(1-s)b,\n\\] \n\nso that \n\n\\[\nKB\\cdot KC = 4b^2 s(1-s). \\tag{1}\n\\] \n\nDenote \\(OP = r>0\\). The given condition \\(KB\\cdot KC = \\frac12\\,OP^2\\) yields \n\n\\[\n4b^2 s(1-s) = \\frac{r^2}{2}\\quad\\Longrightarrow\\quad 8b^2 s(1-s)=r^2. \\tag{2}\n\\] \n\nThe power of \\(K\\) with respect to \\(\\Gamma\\) gives \n\n\\[\n\\operatorname{Pow}_\\Gamma(K)=OK^2-1 = -KB\\cdot KC = -\\frac{r^2}{2},\n\\] \n\nhence \n\n\\[\nOK^2 = 1-\\frac{r^2}{2}. \\tag{3}\n\\] \n\nFrom the coordinates, \n\n\\[\nOK^2 = a^2 + b^2(1-2s)^2 = 1 - 4b^2 s(1-s),\n\\] \n\nwhich is consistent with (2) and (3). \n\n---\n\n### 2. The concyclicity condition and a linear function \n\nLet \\(\\omega\\) be the circle through \\(P,A,K,D\\). Define \n\n\\[\nL(X)=\\operatorname{Pow}_\\Gamma(X)-\\operatorname{Pow}_\\omega(X).\n\\] \n\nBecause the equations of both circles contain the same quadratic terms \\(x^2+y^2\\), \\(L\\) is an affine linear function: \\(L(X)=ux+vy+w\\). \n\nSince \\(K\\in\\omega\\), \\(\\operatorname{Pow}_\\omega(K)=0\\), and (3) gives \n\n\\[\nL(K)=\\operatorname{Pow}_\\Gamma(K)=-\\frac{r^2}{2}. \\tag{4}\n\\] \n\nBecause \\(K\\) lies on \\(BC\\), it can be written as the affine combination \n\n\\[\nK = (1-s)B + sC.\n\\] \n\nBy linearity of \\(L\\), \n\n\\[\nL(K) = (1-s)L(B)+sL(C). \\tag{5}\n\\] \n\nWe now compute \\(L(B)\\) and \\(L(C)\\). \n\n---\n\n### 3. Computing \\(L(B)\\) and \\(L(C)\\) \n\nPoints \\(P,A,B\\) are collinear. Choose a coordinate on line \\(BP\\) with origin at \\(P\\) and positive direction towards \\(B\\). Let \n\n\\[\nPB = d_B>0,\\qquad PA = d_A>0.\n\\] \n\nFrom the order in a convex quadrilateral (as will be justified later) we have \\(P\\!-\\!A\\!-\\!B\\); thus \\(0<d_A<d_B\\). \n\nThe power of \\(P\\) with respect to \\(\\Gamma\\) is \n\n\\[\np = \\operatorname{Pow}_\\Gamma(P)=OP^2-1 = r^2-1 = d_A d_B. \\tag{6}\n\\] \n\nNow consider point \\(B\\). The line \\(BP\\) meets \\(\\omega\\) at \\(P\\) and \\(A\\), therefore \n\n\\[\n\\operatorname{Pow}_\\omega(B) = BA\\cdot BP,\n\\] \n\nwhere the distances are signed according to the same orientation (from \\(B\\) towards \\(P\\) as positive). In our coordinate from \\(P\\), \n\n\\[\nBA = d_A - d_B,\\qquad BP = -d_B,\n\\] \n\nso \n\n\\[\nBA\\cdot BP = (d_A-d_B)(-d_B) = d_B^2 - d_A d_B = PB^2 - p.\n\\] \n\nThus \n\n\\[\n\\operatorname{Pow}_\\omega(B)= PB^2 - p.\n\\] \n\nBecause \\(\\operatorname{Pow}_\\Gamma(B)=0\\), we obtain \n\n\\[\nL(B)=0 - \\operatorname{Pow}_\\omega(B) = p - PB^2. \\tag{7}\n\\] \n\nAn identical argument for point \\(C\\) yields \n\n\\[\nL(C) = p - PC^2. \\tag{8}\n\\] \n\n---\n\n### 4. A key relation involving \\(PB^2\\) and \\(PC^2\\) \n\nSubstitute (4), (7), (8) into (5): \n\n\\[\n-\\frac{r^2}{2} = (1-s)(p-PB^2)+s(p-PC^2) = p - \\bigl[(1-s)PB^2+s\\,PC^2\\bigr].\n\\] \n\nHence \n\n\\[\n(1-s)PB^2+s\\,PC^2 = p + \\frac{r^2}{2}\n= (r^2-1)+\\frac{r^2}{2} = \\frac{3r^2-2}{2}. \\tag{9}\n\\] \n\n---\n\n### 5. Express \\(PB^2\\), \\(PC^2\\) in coordinates \n\nWrite \\(P\\) in polar form: \\(P = (r\\cos\\varphi,\\;r\\sin\\varphi)\\). Using the coordinates of \\(B\\) and \\(C\\), \n\n\\[\nPB^2 = r^2+1-2r\\cos(\\varphi-\\beta),\\qquad\nPC^2 = r^2+1-2r\\cos(\\varphi+\\beta). \\tag{10}\n\\] \n\nInsert (10) into (9). The sum \\((1-s)(r^2+1)+s(r^2+1)=r^2+1\\) cancels, leaving \n\n\\[\n-2r\\bigl[(1-s)\\cos(\\varphi-\\beta)+s\\cos(\\varphi+\\beta)\\bigr] = \\frac{3r^2-2}{2} - (r^2+1) = \\frac{3r^2-2-2r^2-2}{2} = \\frac{r^2-4}{2}.\n\\] \n\nThus \n\n\\[\n(1-s)\\cos(\\varphi-\\beta)+s\\cos(\\varphi+\\beta) = \\frac{4-r^2}{4r}. \\tag{11}\n\\] \n\nExpanding the left\u2011hand side: \n\n\\[\n\\cos(\\varphi-\\beta) = \\cos\\varphi\\cos\\beta + \\sin\\varphi\\sin\\beta,\\qquad\n\\cos(\\varphi+\\beta) = \\cos\\varphi\\cos\\beta - \\sin\\varphi\\sin\\beta,\n\\] \n\ngives \n\n\\[\n(1-s)\\cos(\\varphi-\\beta)+s\\cos(\\varphi+\\beta) = \\cos\\beta\\cos\\varphi + (1-2s)\\sin\\beta\\sin\\varphi. \\tag{12}\n\\] \n\nHence (11) becomes \n\n\\[\n\\cos\\beta\\cos\\varphi + (1-2s)\\sin\\beta\\sin\\varphi = \\frac{4-r^2}{4r}. \\tag{13}\n\\] \n\n---\n\n### 6. Application of Cauchy\u2011Schwarz and determination of \\(OP\\) \n\nThe left side of (13) is the dot product of the vectors \n\n\\[\n\\mathbf{u}=(\\cos\\beta,\\;(1-2s)\\sin\\beta),\\qquad \\mathbf{v}=(\\cos\\varphi,\\sin\\varphi).\n\\] \n\nNote that \\(\\mathbf{u}\\) is exactly the coordinate vector of \\(K\\) because \\(K=(a,b(1-2s))\\). \nTherefore \n\n\\[\n\\|\\mathbf{u}\\| = OK = \\sqrt{1-\\frac{r^2}{2}}\\qquad\\text{(by (3))},\\qquad \\|\\mathbf{v}\\|=1.\n\\] \n\nBy the Cauchy\u2011Schwarz inequality, \n\n\\[\n|\\mathbf{u}\\cdot\\mathbf{v}| \\le \\|\\mathbf{u}\\|\\,\\|\\mathbf{v}\\| = \\sqrt{1-\\frac{r^2}{2}}.\n\\] \n\nConsequently \n\n\\[\n\\left|\\frac{4-r^2}{4r}\\right| \\le \\sqrt{1-\\frac{r^2}{2}}. \\tag{14}\n\\] \n\nBoth sides are non\u2011negative. Squaring (14) and multiplying by \\(16r^2\\) yields \n\n\\[\n(4-r^2)^2 \\le 16r^2-8r^4.\n\\] \n\nExpanding and simplifying: \n\n\\[\nr^4-8r^2+16 \\le 16r^2-8r^4\n\\quad\\Longrightarrow\\quad 9r^4-24r^2+16 \\le 0\n\\quad\\Longrightarrow\\quad (3r^2-4)^2 \\le 0.\n\\] \n\nHence \\(3r^2-4=0\\) and, because \\(r>0\\), \n\n\\[\n\\boxed{OP = r = \\frac{2}{\\sqrt{3}}}.\n\\] \n\n---\n\n### 7. Consequences of equality \n\nEquality in (14) forces \\(\\mathbf{u}\\) and \\(\\mathbf{v}\\) to be parallel. Moreover, \n\n\\[\n\\|\\mathbf{u}\\| = OK = \\sqrt{1-\\frac{2}{3}} = \\frac{1}{\\sqrt{3}},\\qquad \\mathbf{v}\\text{ is a unit vector}.\n\\] \n\nThus \\(\\mathbf{u} = \\frac{1}{\\sqrt{3}}\\,\\mathbf{v}\\), i.e. \n\n\\[\nK = \\frac{1}{\\sqrt{3}}(\\cos\\varphi,\\sin\\varphi),\\qquad \nP = r(\\cos\\varphi,\\sin\\varphi) = \\frac{2}{\\sqrt{3}}(\\cos\\varphi,\\sin\\varphi) = 2K.\n\\] \n\nTherefore \\(O,K,P\\) are collinear and \\(K\\) is the midpoint of \\(OP\\). \n\nFrom (2) with \\(r^2=4/3\\) we obtain \n\n\\[\n8b^2 s(1-s) = \\frac{4}{3}\\quad\\Longrightarrow\\quad b^2 s(1-s) = \\frac{1}{6}. \\tag{15}\n\\] \n\n---\n\n### 8. Coordinates of \\(A\\) and \\(D\\) \n\nSince \\(P\\) lies outside \\(\\Gamma\\), the second intersections of lines \\(BP\\) and \\(CP\\) with \\(\\Gamma\\) are \\(A\\) and \\(D\\) respectively. Using the secant construction: \n\n\\[\nA = P + \\lambda\\,(B-P),\\qquad D = P + \\mu\\,(C-P),\n\\] \n\nwhere \n\n\\[\n\\lambda = \\frac{\\operatorname{Pow}_\\Gamma(P)}{PB^2} = \\frac{1/3}{PB^2},\\qquad \n\\mu = \\frac{1/3}{PC^2}.\n\\] \n\nWe compute \\(PB^2\\) and \\(PC^2\\) explicitly. \n\n\\[\nB-P = (-a,\\; b - 2b(1-2s)) = (-a,\\; b(4s-1)),\n\\] \n\n\\[\nPB^2 = a^2 + b^2(4s-1)^2.\n\\] \n\nUsing \\(a^2 = 1-b^2\\) and (15) we simplify: \n\n\\[\nPB^2 = 1 + 8b^2 s(2s-1) = 1 + \\frac{4}{3}\\cdot\\frac{2s-1}{1-s}\n= \\frac{5s-1}{3(1-s)}. \\tag{16}\n\\] \n\nHence \n\n\\[\n\\lambda = \\frac{1/3}{PB^2} = \\frac{1-s}{5s-1}. \\tag{17}\n\\] \n\nSimilarly, \n\n\\[\nC-P = (-a,\\; -b-2b(1-2s)) = (-a,\\; b(4s-3)),\n\\] \n\n\\[\nPC^2 = a^2 + b^2(4s-3)^2 = 1 - 8b^2 (2s-1)(1-s)\n= \\frac{4-5s}{3s}. \\tag{18}\n\\] \n\nThus \n\n\\[\n\\mu = \\frac{1/3}{PC^2} = \\frac{s}{4-5s}. \\tag{19}\n\\] \n\nNow \n\n\\[\nA = \\bigl(a(2-\\lambda),\\; b[2(1-2s)+\\lambda(4s-1)]\\bigr), \\tag{20}\n\\] \n\n\\[\nD = \\bigl(a(2-\\mu),\\; b[2(1-2s)+\\mu(4s-3)]\\bigr). \\tag{21}\n\\] \n\n---\n\n### 9. Intersection \\(Q\\) of the diagonals \n\nWe find \\(Q = AC \\cap BD\\). \nWrite \n\n\\[\nA-C = \\bigl(a(1-\\lambda),\\; y_A+b\\bigr),\\qquad \nD-B = \\bigl(a(1-\\mu),\\; y_D-b\\bigr).\n\\] \n\nIt is helpful to simplify these differences. Compute \\(1-\\lambda\\) and \\(1-\\mu\\): \n\n\\[\n1-\\lambda = \\frac{6s-2}{5s-1} = \\frac{2(3s-1)}{5s-1},\\qquad\n1-\\mu = \\frac{4-6s}{4-5s} = \\frac{2(2-3s)}{4-5s}. \\tag{22}\n\\] \n\nUsing (20) and (21) we evaluate \\(y_A+b\\) and \\(y_D-b\\). After straightforward algebra (see details below) one obtains \n\n\\[\ny_A+b = -\\frac{4bM}{5s-1},\\qquad \ny_D-b = \\frac{4bM}{4-5s}, \\tag{23}\n\\] \n\nwhere \n\n\\[\nM = 6s^2-6s+1.\n\\] \n\nThus \n\n\\[\nA-C = \\left(\\frac{2a(3s-1)}{5s-1},\\; -\\frac{4bM}{5s-1}\\right),\\qquad\nD-B = \\left(\\frac{2a(2-3s)}{4-5s},\\; \\frac{4bM}{4-5s}\\right). \\tag{24}\n\\] \n\n*Derivation of (23):* \n\n\\[\ny_A+b = b\\bigl[2(1-2s)+\\lambda(4s-1)+1\\bigr] = b\\bigl[3-4s+\\lambda(4s-1)\\bigr].\n\\] \n\nWriting \\(\\lambda = (1-s)/(5s-1)\\) and putting over a common denominator gives \n\n\\[\ny_A+b = b\\,\\frac{(3-4s)(5s-1)+(1-s)(4s-1)}{5s-1}.\n\\] \n\nThe numerator simplifies to \\(-4(6s^2-6s+1) = -4M\\). Hence the first formula in (23). \nFor \\(y_D-b\\): \n\n\\[\ny_D-b = b\\bigl[2(1-2s)+\\mu(4s-3)-1\\bigr] = b\\bigl[1-4s+\\mu(4s-3)\\bigr].\n\\] \n\nUsing \\(\\mu = s/(4-5s)\\) we get \n\n\\[\ny_D-b = b\\,\\frac{(1-4s)(4-5s)+s(4s-3)}{4-5s} = b\\,\\frac{4(6s^2-6s+1)}{4-5s} = \\frac{4bM}{4-5s}.\n\\] \n\nNow solve for \\(Q\\). Parametrise: \n\n\\[\nQ = C + u(A-C),\\qquad Q = B + v(D-B),\\quad u,v\\in\\mathbb{R}.\n\\] \n\nEquating coordinates yields \n\n\\[\na + u\\cdot\\frac{2a(3s-1)}{5s-1} = a + v\\cdot\\frac{2a(2-3s)}{4-5s}\\;\\Longrightarrow\\;\nu\\,\\frac{3s-1}{5s-1} = v\\,\\frac{2-3s}{4-5s}, \\tag{25}\n\\] \n\n\\[\n-b + u\\cdot\\left(-\\frac{4bM}{5s-1}\\right) = b + v\\cdot\\frac{4bM}{4-5s}.\n\\] \n\nDivide the second equation by \\(b\\) and rearrange: \n\n\\[\n-1 - \\frac{4M u}{5s-1} = 1 + \\frac{4M v}{4-5s}\n\\;\\Longrightarrow\\;\n\\frac{4M u}{5s-1} + \\frac{4M v}{4-5s} = -2.\n\\] \n\nDivide by \\(2\\): \n\n\\[\n\\frac{2M u}{5s-1} + \\frac{2M v}{4-5s} = -1. \\tag{26}\n\\] \n\nFrom (25) express \\(v\\) in terms of \\(u\\): \n\n\\[\nv = u\\,\\frac{3s-1}{5s-1}\\cdot\\frac{4-5s}{2-3s}. \\tag{27}\n\\] \n\nSubstitute into (26). The term \\(\\dfrac{2M v}{4-5s}\\) becomes \n\n\\[\n\\frac{2M}{4-5s}\\cdot u\\,\\frac{3s-1}{5s-1}\\cdot\\frac{4-5s}{2-3s}\n= \\frac{2M u\\,(3s-1)}{(5s-1)(2-3s)}.\n\\] \n\nThus (26) reads \n\n\\[\n\\frac{2M u}{5s-1}\\left[1 + \\frac{3s-1}{2-3s}\\right] = -1.\n\\] \n\nThe bracket simplifies: \n\n\\[\n1 + \\frac{3s-1}{2-3s} = \\frac{(2-3s)+(3s-1)}{2-3s} = \\frac{1}{2-3s}.\n\\] \n\nTherefore \n\n\\[\n\\frac{2M u}{(5s-1)(2-3s)} = -1\n\\quad\\Longrightarrow\\quad\nu = -\\frac{(5s-1)(2-3s)}{2M}. \\tag{28}\n\\] \n\nNow the \\(y\\)-coordinate of \\(Q\\) from the \\(AC\\) parametrisation is \n\n\\[\ny_Q = -b + u\\cdot\\left(-\\frac{4bM}{5s-1}\\right)\n= -b - \\frac{4bM}{5s-1}\\,u.\n\\] \n\nInsert (28): \n\n\\[\ny_Q = -b - \\frac{4bM}{5s-1}\\left(-\\frac{(5s-1)(2-3s)}{2M}\\right)\n= -b + 2b(2-3s) = 3b(1-2s). \\tag{29}\n\\] \n\nThus \n\n\\[\n\\boxed{y_Q = 3b(1-2s)}.\n\\] \n\n---\n\n### 10. Determination of point \\(T\\) \n\nLine \\(BC\\) is vertical, so the perpendicular through \\(Q\\) is horizontal: \\(y = y_Q\\). \nLine \\(OP\\) is the ray from \\(O\\) through \\(P\\). Since \\(P = 2K = (2a,\\,2b(1-2s))\\), its parametric form is \n\n\\[\n(x,y) = (2a\\,\\theta,\\;2b(1-2s)\\,\\theta),\\qquad \\theta\\ge 0.\n\\] \n\nSet the \\(y\\)-coordinate equal to \\(y_Q\\): \n\n\\[\n2b(1-2s)\\,\\theta = 3b(1-2s).\n\\] \n\nBecause \\(b>0\\) and, from the strict inequalities of the problem, \\(1-2s\\neq 0\\) (as will be shown), we may divide to obtain \\(\\theta = 3/2\\). Hence \n\n\\[\nT = \\bigl(2a\\cdot\\tfrac32,\\;2b(1-2s)\\cdot\\tfrac32\\bigr) = \\bigl(3a,\\;3b(1-2s)\\bigr). \\tag{30}\n\\] \n\n---\n\n### 11. Computation of \\(TB+TC\\) \n\nWe have \n\n\\[\nB = (a,b),\\quad C = (a,-b),\\quad T = (3a,\\,3b(1-2s)).\n\\] \n\nDefine \n\n\\[\nu = 3(1-2s). \\] \n\nThen \\(T = (3a,\\, b\\,u)\\). Distances: \n\n\\[\nTB^2 = (3a-a)^2 + (bu - b)^2 = 4a^2 + b^2(u-1)^2,\n\\] \n\n\\[\nTC^2 = 4a^2 + b^2(u+1)^2.\n\\] \n\nExpress \\(a^2\\) and \\(b^2\\) in terms of \\(u\\). From (15): \\(b^2 s(1-s) = 1/6\\). \nSince \\(u = 3(1-2s)\\), we solve for \\(s\\): \n\n\\[\ns = \\frac{3-u}{6},\\qquad 1-s = \\frac{3+u}{6}.\n\\] \n\nThen \n\n\\[\ns(1-s) = \\frac{(3-u)(3+u)}{36} = \\frac{9-u^2}{36}.\n\\] \n\nThus \n\n\\[\nb^2 = \\frac{1}{6\\,s(1-s)} = \\frac{1}{6\\cdot\\frac{9-u^2}{36}} = \\frac{6}{9-u^2}. \\tag{31}\n\\] \n\n\\[\na^2 = 1 - b^2 = 1 - \\frac{6}{9-u^2} = \\frac{3-u^2}{9-u^2}. \\tag{32}\n\\] \n\nNow \n\n\\[\nTB^2 = 4\\cdot\\frac{3-u^2}{9-u^2} + \\frac{6}{9-u^2}\\,(u-1)^2\n= \\frac{4(3-u^2)+6(u-1)^2}{9-u^2}.\n\\] \n\nSimplify the numerator: \n\n\\[\n4(3-u^2)+6(u-1)^2 = 12-4u^2+6(u^2-2u+1)=12-4u^2+6u^2-12u+6\n= 18+2u^2-12u = 2(u^2-6u+9) = 2(u-3)^2.\n\\] \n\nHence \n\n\\[\nTB = \\frac{|u-3|\\sqrt{2}}{\\sqrt{9-u^2}}.\n\\] \n\nSimilarly, \n\n\\[\nTC^2 = 4\\cdot\\frac{3-u^2}{9-u^2} + \\frac{6}{9-u^2}\\,(u+1)^2\n= \\frac{4(3-u^2)+6(u+1)^2}{9-u^2}.\n\\] \n\n\\[\n4(3-u^2)+6(u+1)^2 = 12-4u^2+6(u^2+2u+1)=12-4u^2+6u^2+12u+6\n= 18+2u^2+12u = 2(u^2+6u+9)=2(u+3)^2.\n\\] \n\nThus \n\n\\[\nTC = \\frac{|u+3|\\sqrt{2}}{\\sqrt{9-u^2}}.\n\\] \n\nFor the admissible range of \\(s\\) (to be determined) we have \\(u\\in(-1,0)\\). In that interval \\(u-3<0\\), \\(u+3>0\\), so \n\n\\[\nTB = \\frac{(3-u)\\sqrt{2}}{\\sqrt{9-u^2}},\\qquad\nTC = \\frac{(3+u)\\sqrt{2}}{\\sqrt{9-u^2}}.\n\\] \n\nTherefore \n\n\\[\nTB+TC = \\frac{\\sqrt{2}}{\\sqrt{9-u^2}}\\bigl((3-u)+(3+u)\\bigr)\n= \\frac{6\\sqrt{2}}{\\sqrt{9-u^2}}. \\tag{33}\n\\] \n\n---\n\n### 12. Admissible range of \\(s\\) \n\nThe problem imposes \n\n\\[\n\\angle ABC < \\angle BCD < 90^\\circ\n\\] \n\nand the quadrilateral is convex with vertices labeled consecutively. \n\nWe first obtain expressions for \\(\\tan\\angle ABC\\) and \\(\\tan\\angle BCD\\) using coordinates. \n\n**Angle at \\(B\\):** \nVectors \\(BA = A-B\\) and \\(BC = C-B = (0,-2b)\\). \n\n\\[\nBA = (a(1-\\lambda),\\; y_A-b).\n\\] \n\nWe previously found \n\n\\[\na(1-\\lambda) = a\\cdot\\frac{2(3s-1)}{5s-1},\\qquad \nb - y_A = b(4s-1)(1-\\lambda).\n\\] \n\nSince \\(BC\\) is vertical downward, the angle between \\(BA\\) and the downward direction satisfies \n\n\\[\n\\tan\\angle ABC = \\frac{|a(1-\\lambda)|}{b-y_A} = \\frac{a}{b(4s-1)}. \\tag{34}\n\\] \n\n(The derivation using the cross product and dot product gives the same result, and the angle is acute when \\(b-y_A>0\\), i.e. when \\(4s-1>0\\).) \n\n**Angle at \\(C\\):** \nVectors \\(CB = B-C = (0,2b)\\) (upward) and \\(CD = D-C = (a(1-\\mu),\\; y_D+b)\\). \n\nWe have \n\n\\[\na(1-\\mu) = a\\cdot\\frac{2(2-3s)}{4-5s},\\qquad \ny_D+b = b(3-4s)(1-\\mu).\n\\] \n\nBecause \\(CB\\) is vertical upward, \n\n\\[\n\\tan\\angle BCD = \\frac{|a(1-\\mu)|}{y_D+b} = \\frac{a}{b(3-4s)}. \\tag{35}\n\\] \n\nAcuteness requires \\(y_D+b>0\\), i.e. \\(3-4s>0\\). \n\nNow the conditions: \n\n- \\(\\angle ABC,\\angle BCD\\) acute \\(\\Longrightarrow 4s-1>0\\) and \\(3-4s>0\\) \\(\\Longrightarrow \\frac14 < s < \\frac34\\). \n- \\(\\angle ABC < \\angle BCD\\) (both acute, so tangents are increasing) \\(\\Longrightarrow\\) \n\n\\[\n\\frac{a}{b(4s-1)} < \\frac{a}{b(3-4s)}\n\\;\\Longleftrightarrow\\; 3-4s < 4s-1\n\\;\\Longleftrightarrow\\; s > \\frac12.\n\\] \n\nThus \\(s\\in (\\frac12,\\frac34)\\). \n\n**Convexity constraints:** \nFor the quadrilateral to be convex with vertices in order \\(A,B,C,D\\), the points must lie on the lines \\(BP\\) and \\(CP\\) in the order \\(P\\!-\\!A\\!-\\!B\\) and \\(P\\!-\\!D\\!-\\!C\\). This is equivalent to \\(0<\\lambda<1\\) and \\(0<\\mu<1\\). \n\nFrom (17): \\(\\lambda = \\dfrac{1-s}{5s-1}\\). \n\\(\\lambda>0\\) requires \\(5s-1>0\\) (already true for \\(s>\\frac12\\)), and \\(\\lambda<1\\) gives \n\n\\[\n\\frac{1-s}{5s-1}<1 \\;\\Longleftrightarrow\\; 1-s < 5s-1 \\;\\Longleftrightarrow\\; s>\\frac13.\n\\] \n\nSo \\(\\lambda\\in(0,1)\\) holds for \\(s>\\frac13\\). \n\nFrom (19): \\(\\mu = \\dfrac{s}{4-5s}\\). \n\\(\\mu>0\\) requires \\(4-5s>0\\) i.e. \\(s<\\frac45\\); \\(\\mu<1\\) gives \n\n\\[\n\\frac{s}{4-5s}<1 \\;\\Longleftrightarrow\\; s < 4-5s \\;\\Longleftrightarrow\\; s<\\frac23.\n\\] \n\nHence \\(\\mu\\in(0,1)\\) gives \\(s<\\frac23\\). \n\nConvexity therefore requires \\(s\\in(\\frac13,\\frac23)\\). \n\nIntersecting this with \\(s\\in(\\frac12,\\frac34)\\) yields \n\n\\[\n\\boxed{s\\in\\left(\\frac12,\\,\\frac23\\right)}.\n\\] \n\nAt the endpoints the strict angle inequalities fail (\\(s=\\frac12\\) gives equality) or the quadrilateral degenerates (\\(s=\\frac23\\) gives \\(D\\equiv C\\)). Hence \\(s\\) varies strictly inside this open interval. \n\nFor these values, \\(1-2s<0\\) and \n\n\\[\nu = 3(1-2s) \\in (-1,\\,0).\n\\] \n\n---\n\n### 13. Possible values of \\(TB+TC\\) \n\nFrom (33), \\(TB+TC = \\dfrac{6\\sqrt{2}}{\\sqrt{9-u^2}}\\) with \\(u\\in(-1,0)\\). As \\(s\\) increases from \\(\\frac12\\) to \\(\\frac23\\), \\(u\\) decreases continuously from \\(0\\) to \\(-1\\) and the function is strictly increasing (since \\(9-u^2\\) decreases). Therefore \\(TB+TC\\) takes all values between its limits at the endpoints: \n\n\\[\n\\lim_{u\\to 0^-} TB+TC = \\frac{6\\sqrt{2}}{3} = 2\\sqrt{2},\\qquad\n\\lim_{u\\to -1^+} TB+TC = \\frac{6\\sqrt{2}}{\\sqrt{8}} = 3.\n\\] \n\nBecause the endpoints are not attained, \n\n\\[\n\\boxed{2\\sqrt{2} < TB+TC < 3}.\n\\] \n\n---\n\n### 14. Summary \n\n\\[\n\\boxed{OP = \\frac{2}{\\sqrt{3}}},\\qquad\n\\boxed{2\\sqrt{2} < TB+TC < 3}.\n\\]", "average_automatic_rating": 1.0, "human_rating": 18}}
3
+ {"question": "Let $n$ be an positive integer. There are $n$ red cards and $n$ blue cards. Initially, there is a real number $0$ on each red card, and a real number $1$ on each blue card. One operation is: choose a red card and a blue card, such that the real number $x$ on the red card is smaller than the real number $y$ on the blue card, erase these two numbers and write down $\\frac{x + y}{2}$ instead on both cards.\nFind the smallest positive integer $n$, such that one can appropriately operate finite times to make the sum of real numbers on red cards be larger than $100$.", "problem_idx": "CMO2025-3", "model_prediction": {"proof": "We have \\(n\\) red cards (each initially \\(0\\)) and \\(n\\) blue cards (each initially \\(1\\)). \nAn operation consists of choosing a red card with value \\(x\\) and a blue card with value \\(y\\) such that \\(x<y\\), erasing both numbers and writing \\(\\frac{x+y}{2}\\) on **both** cards.\n\nLet \\(R\\) be the sum of numbers on the red cards and \\(B\\) the sum on the blue cards. \nThe total sum \\(R+B\\) is invariant because \n\\[\n(x+y)\\;\\longrightarrow\\;2\\cdot\\frac{x+y}{2}=x+y.\n\\] \nInitially \\(R+B=n\\). Each operation increases \\(R\\) by \\(\\frac{y-x}{2}>0\\) and decreases \\(B\\) by the same amount. \nTo maximise \\(R\\) we continue until no further operation is possible, i.e. until \n\\[\n\\min\\{\\text{red values}\\}\\ge \\max\\{\\text{blue values}\\}.\n\\]\n\n---\n\n### 1. Optimal order for a fixed blue card \n\n**Lemma\u202f1.** \nFor a fixed blue card with current value \\(b\\), the total increase of the red sum is maximised if we always choose, among the red cards whose value is less than \\(b\\), the one with the **largest** value. \n\n*Proof.* \nLet two red cards have values \\(r<s<b\\). Compare two orders:\n\n* \\(A\\): use \\(s\\) first, then \\(r\\); \n* \\(B\\): use \\(r\\) first, then (if possible) \\(s\\).\n\nDenote the initial blue value by \\(b\\).\n\n- Order \\(A\\): \n First operation: \\(\\Delta_1=\\frac{b-s}{2}\\); new blue \\(b'=\\frac{s+b}{2}\\). \n Second operation (always possible because \\(b'>s>r\\)): \\(\\Delta_2=\\frac{b'-r}{2}=\\frac{s+b-2r}{4}\\). \n Total \\(\\Delta_A=\\frac{b-s}{2}+\\frac{s+b-2r}{4}=\\frac{3b-s-2r}{4}\\).\n\n- Order \\(B\\): \n First: \\(\\Delta_1'=\\frac{b-r}{2}\\); new blue \\(b''=\\frac{r+b}{2}\\). \n If \\(b''>s\\) then \\(\\Delta_2'=\\frac{b''-s}{2}=\\frac{r+b-2s}{4}\\), total \\(\\Delta_B=\\frac{b-r}{2}+\\frac{r+b-2s}{4}=\\frac{3b-r-2s}{4}\\). \n If \\(b''\\le s\\) the second operation is impossible and \\(\\Delta_B=\\frac{b-r}{2}\\).\n\nIn the first case \\(\\Delta_A-\\Delta_B=\\frac{s-r}{4}>0\\); in the second case \\(\\Delta_A-\\Delta_B=\\frac{b-s}{4}>0\\). \nThus \\(\\Delta_A>\\Delta_B\\). By repeatedly improving any non\u2011optimal order we obtain that the decreasing order of reds is optimal. \u220e \n\n**Corollary.** \nIf initially all red values are less than \\(b\\), the optimal procedure uses every red exactly once, in decreasing order of their current values, and ends when the blue value equals the smallest red.\n\n---\n\n### 2. Global ordering of operations \n\n**Lemma\u202f2.** \nIn an optimal sequence, for each red card the values of the blue cards at the moments it is used form a non\u2011decreasing sequence. \n\n*Proof.* \nSuppose, for contradiction, that an optimal sequence \\(\\mathcal S\\) contains a red card \\(R\\) that is used with a blue card \\(A\\) of value \\(a\\) and later with a blue card \\(B\\) of value \\(b<a\\). Choose such a triple with the smallest possible number of operations between the two uses (i.e., minimise \\(t_2-t_1\\)). Denote these operations by \\(O_1=(R,A)\\) at step \\(t_1\\) and \\(O_2=(R,B)\\) at step \\(t_2\\).\n\nFirst we show that there is no operation involving \\(R\\) strictly between \\(t_1\\) and \\(t_2\\). If there were an operation \\(O'=(R,C)\\) with \\(t_1<t'<t_2\\), let its blue value be \\(c\\). Because \\(t_2-t'<t_2-t_1\\), the minimality of our choice forces that \\(c\\ge a\\) (otherwise \\(O_1\\) and \\(O'\\) would be a closer decrease). But then \\(c\\ge a > b\\), so \\(O'\\) and \\(O_2\\) would be a decrease with fewer operations between them, contradicting minimality. Hence no operation with \\(R\\) lies between \\(O_1\\) and \\(O_2\\).\n\nNow consider any operation \\(X\\) that occurs between \\(O_1\\) and \\(O_2\\). Because \\(X\\) does not involve \\(R\\), it must involve a blue card and a red card different from \\(R\\). We distinguish three types:\n\n1. \\(X\\) involves \\(A\\) (and some red \\(S\\neq R\\)). Since \\(X\\) uses \\(A\\) and \\(S\\), it is disjoint from the set \\(\\{R,B\\}\\) (the cards of \\(O_2\\)). Therefore we can swap \\(X\\) with \\(O_2\\), moving \\(X\\) after \\(O_2\\), without affecting the final configuration or the legality of the operations (because \\(X\\) does not change \\(R\\) or \\(B\\), and \\(O_2\\) does not change \\(A\\) or \\(S\\)).\n\n2. \\(X\\) involves \\(B\\) (and some red \\(T\\neq R\\)). Then \\(X\\) is disjoint from \\(\\{R,A\\}\\) and can be swapped with \\(O_1\\), moving \\(X\\) before \\(O_1\\).\n\n3. \\(X\\) involves neither \\(A\\) nor \\(B\\). Then \\(X\\) is disjoint from both \\(\\{R,A\\}\\) and \\(\\{R,B\\}\\), so it can be swapped either with \\(O_1\\) or with \\(O_2\\); we move it before \\(O_1\\) or after \\(O_2\\) arbitrarily.\n\nRepeating these swaps for every operation between \\(O_1\\) and \\(O_2\\), we obtain a new sequence \\(\\mathcal S'\\) in which \\(O_1\\) and \\(O_2\\) are consecutive and all other operations are unchanged. Moreover, these swaps do not alter the total red sum because disjoint operations commute.\n\nNow examine the two consecutive operations \\(O_1\\) and \\(O_2\\). Let \\(r\\) be the value of \\(R\\) just before \\(O_1\\), and let \\(a\\) and \\(b\\) be the values of \\(A\\) and \\(B\\) at that moment (note that \\(b<a\\) by assumption). Legality of \\(O_1\\) gives \\(r<a\\). Legality of \\(O_2\\) in the original (after \\(O_1\\)) gives \\(\\frac{r+a}{2}<b\\), i.e. \\(r+a<2b\\). Since \\(a>b\\), we have \\(r<2b-a<b\\), so \\(r<b\\).\n\nWe compare the total increase in red sum contributed by these two operations in the original order and in the swapped order.\n\n- Original order (\\(O_1\\) then \\(O_2\\)):\n \\[\n \\Delta_{\\text{orig}} = \\frac{a-r}{2} + \\frac{b-\\frac{r+a}{2}}{2}\n = \\frac{a+2b-3r}{4}.\n \\]\n- Swapped order (\\(O_2\\) then \\(O_1\\)):\n \\[\n \\Delta_{\\text{swap}} = \\frac{b-r}{2} + \\frac{a-\\frac{r+b}{2}}{2}\n = \\frac{2a+b-3r}{4}.\n \\]\n\nBecause \\(a>b\\), we have \\(\\Delta_{\\text{swap}} - \\Delta_{\\text{orig}} = \\frac{a-b}{4} > 0\\). Furthermore, after swapping the two operations are still legal: after \\(O_2\\) the new value of \\(R\\) is \\(\\frac{r+b}{2}\\), which is less than \\(a\\) because \\(r<b<a\\) implies \\(\\frac{r+b}{2} < a\\). Hence the swapped sequence yields a strictly larger total red sum while still being valid. This contradicts the optimality of \\(\\mathcal S\\). Therefore no such decrease can exist. \u220e \n\n**Proposition\u202f1.** \nThere exists an optimal sequence in which the blue cards are processed one after another: we take an ordering of the blues, and for each blue in turn we perform operations with it (using the reds in decreasing order) until it is exhausted, before moving to the next blue. \n\n*Proof.* \nConsider any optimal sequence. Let \\(B_1\\) be the blue used in the first operation. Suppose that before \\(B_1\\) has been used with all reds, an operation involving a different blue \\(B_2\\) occurs; take the earliest such operation. \n\nLet \\(R\\) be a red that will be used with \\(B_1\\) later (such a red exists because \\(B_1\\) is not yet exhausted). \n- If the \\(B_2\\) operation involved \\(R\\), then \\(R\\) would meet \\(B_2\\) (value \\(1\\)) before later meeting \\(B_1\\) (value \\(<1\\)), contradicting Lemma\u202f2. Hence it involves another red \\(S\\). \n- If \\(S\\) were later used with \\(B_1\\), then \\(S\\) would meet \\(B_2\\) (value \\(1\\)) and later \\(B_1\\) (value \\(<1\\)), again contradicting Lemma\u202f2. Thus \\(S\\) is already finished with \\(B_1\\). \n\nThe operation \\((S,B_2)\\) and the future operation \\((R,B_1)\\) involve four distinct cards; therefore they can be swapped without affecting the final outcome. By repeatedly swapping we can move the \\((S,B_2)\\) operation after the whole block of \\(B_1\\) operations. Applying this argument to every intrusion of another blue, we obtain an optimal sequence where \\(B_1\\) is completely processed before any other blue is touched. \n\nAfter removing \\(B_1\\) (its final value is the smallest and will never be used again), the same reasoning applied inductively shows that the remaining blues can be processed consecutively as well. \n\nFinally, inside each blue\u2019s block we may reorder the operations to follow the descending order of the reds (Lemma\u202f1) without changing the total red sum. \u220e \n\n---\n\n### 3. The greedy algorithm and recurrence \n\nFrom now on we work with the optimal strategy described in Proposition\u202f1. Sort the reds in non\u2011increasing order: \\(r_1\\ge r_2\\ge\\dots\\ge r_n\\). Initially \\(r_i^{(0)}=0\\). \n\nProcessing the next blue (starting at \\(1\\)) updates the reds as follows: \n\n\\[\n\\begin{aligned}\nr_1^{(t)} &= \\frac{1 + r_1^{(t-1)}}{2}, \\\\[4pt]\nr_i^{(t)} &= \\frac{r_{i-1}^{(t)} + r_i^{(t-1)}}{2}, \\qquad i=2,\\dots,n.\n\\end{aligned}\n\\tag{1}\n\\]\n\nIt is easy to verify by induction that the order is preserved. \n\n---\n\n### 4. Extension to an infinite system \n\nTo solve (1) we consider an auxiliary infinite set of red cards indexed by \\(i=1,2,3,\\dots\\), all initially \\(0\\). Process \\(n\\) blues using the same rule, i.e. for each blue we define the transformation (1) for all \\(i\\ge1\\). This yields an infinite sequence \\(\\bigl(r_i^{(t)}\\bigr)_{i\\ge1}\\) for each \\(t\\). For every \\(t\\le n\\) and \\(i\\le n\\) the value coincides with that of the original finite system, because the extra reds do not influence the first \\(n\\) positions. Thus we may work with the infinite system. \n\n---\n\n### 5. Generating function \n\nDefine \n\n\\[\nF_t(x) = \\sum_{i=1}^{\\infty} r_i^{(t)} x^{i-1} \\qquad (t=0,1,\\dots,n),\n\\]\n\na formal power series. From (1) we derive \n\n\\[\n(2-x)F_t(x) = 1 + F_{t-1}(x). \\tag{2}\n\\]\n\nIndeed, \n\n\\[\n\\begin{aligned}\nF_t(x) &= \\frac{1+r_1^{(t-1)}}{2} + \\frac12\\sum_{i\\ge2} r_{i-1}^{(t)} x^{i-1} + \\frac12\\sum_{i\\ge2} r_i^{(t-1)} x^{i-1} \\\\\n&= \\frac12 + \\frac{x}{2}F_t(x) + \\frac12 F_{t-1}(x),\n\\end{aligned}\n\\] \n\nwhich rearranges to \\((2-x)F_t = 1 + F_{t-1}\\). \n\nStarting with \\(F_0(x)=0\\), iteration gives \n\n\\[\nF_n(x) = \\frac{(2-x)^n - 1}{(1-x)(2-x)^n}. \\tag{3}\n\\]\n\n---\n\n### 6. Total red sum and blue sum \n\nThe total red sum after \\(n\\) blues is \\(R_{\\max}(n) = \\sum_{i=1}^n r_i^{(n)}\\). Observe that \n\n\\[\n\\frac{F_n(x)}{1-x} = \\sum_{m=0}^{\\infty} \\biggl( \\sum_{i=1}^{m+1} r_i^{(n)} \\biggr) x^m,\n\\] \n\nso the coefficient of \\(x^{n-1}\\) equals \\(R_{\\max}(n)\\). Using (3), \n\n\\[\n\\frac{F_n(x)}{1-x} = \\frac{1}{(1-x)^2} - \\frac{1}{(1-x)^2(2-x)^n}.\n\\] \n\nThe coefficient of \\(x^{n-1}\\) in \\(\\frac{1}{(1-x)^2}\\) is \\(n\\). Hence \n\n\\[\nR_{\\max}(n) = n - B(n), \\qquad B(n) = [x^{n-1}] \\frac{1}{(1-x)^2(2-x)^n}. \\tag{4}\n\\]\n\n\\(B(n)\\) is the sum of the final blue values. \n\n---\n\n### 7. Series expansion of \\(B(n)\\) \n\n\\[\n\\frac{1}{(1-x)^2} = \\sum_{j=0}^{\\infty} (j+1)x^j,\\qquad\n\\frac{1}{(2-x)^n} = \\sum_{k=0}^{\\infty} \\binom{n+k-1}{k} \\frac{x^k}{2^{n+k}}.\n\\] \n\nMultiplying and taking the coefficient of \\(x^{n-1}\\) gives \n\n\\[\nB(n) = \\sum_{k=0}^{n-1} (n-k) \\frac{\\binom{n+k-1}{k}}{2^{n+k}}. \\tag{5}\n\\] \n\nDefine \n\n\\[\ng_k^{(n)} = \\frac{\\binom{n+k-1}{k}}{2^{n+k}}, \\quad k\\ge 0.\n\\]\n\n---\n\n### 8. Recurrence for \\(g_k^{(n)}\\) \n\nFrom \\((2-x)\\frac{1}{(2-x)^n} = \\frac{1}{(2-x)^{n-1}}\\) we obtain \n\n\\[\n(2-x)\\sum_{k\\ge0} g_k^{(n)} x^k = \\sum_{k\\ge0} g_k^{(n-1)} x^k.\n\\] \n\nComparing coefficients: \n\n\\[\n2g_0^{(n)} = g_0^{(n-1)},\\qquad\n2g_k^{(n)} - g_{k-1}^{(n)} = g_k^{(n-1)}\\;\\;(k\\ge1). \\tag{6}\n\\]\n\n---\n\n### 9. The sum \\(A_n = \\sum_{k=0}^{n-1} g_k^{(n)}\\) \n\nWe prove \\(A_n = \\frac12\\) for all \\(n\\ge1\\). \n\nSum (6) for \\(k=0,\\dots,n-1\\) (with \\(g_{-1}^{(n)}=0\\)): \n\n\\[\n2\\sum_{k=0}^{n-1} g_k^{(n)} - \\sum_{k=0}^{n-1} g_{k-1}^{(n)} = \\sum_{k=0}^{n-1} g_k^{(n-1)}.\n\\] \n\nThe second sum equals \\(\\sum_{j=-1}^{n-2} g_j^{(n)} = A_n - g_{n-1}^{(n)}\\). The right-hand side is \\(A_{n-1} + g_{n-1}^{(n-1)}\\) because the sum runs up to \\(k=n-1\\). Hence \n\n\\[\n2A_n - (A_n - g_{n-1}^{(n)}) = A_{n-1} + g_{n-1}^{(n-1)} \\;\\Longrightarrow\\; A_n + g_{n-1}^{(n)} = A_{n-1} + g_{n-1}^{(n-1)}.\n\\] \n\nA direct calculation shows \\(g_{n-1}^{(n)} = g_{n-1}^{(n-1)}\\) (using \\(\\binom{2n-2}{n-1}=2\\binom{2n-3}{n-1}\\)). Thus \\(A_n = A_{n-1}\\). With \\(A_1 = g_0^{(1)} = \\frac12\\), we obtain \\(A_n = \\frac12\\) for all \\(n\\). \n\n---\n\n### 10. Recurrence for \\(B(n)\\) \n\nUsing (5) and (6): \n\n\\[\nB(n) = \\frac12 \\sum_{k=0}^{n-1} (n-k) g_k^{(n-1)} + \\frac12 \\sum_{k=0}^{n-1} (n-k) g_{k-1}^{(n)}.\n\\] \n\nThe first sum splits as \n\n\\[\n\\sum_{k=0}^{n-1} (n-k) g_k^{(n-1)} = \\sum_{k=0}^{n-2} (n-k) g_k^{(n-1)} + g_{n-1}^{(n-1)}.\n\\] \n\nFor \\(k=0,\\dots,n-2\\) write \\(n-k = (n-1-k)+1\\); thus \n\n\\[\n\\sum_{k=0}^{n-2} (n-k) g_k^{(n-1)} = B(n-1) + A_{n-1}.\n\\] \n\nThe second sum, after the substitution \\(j=k-1\\), becomes \n\n\\[\n\\sum_{j=0}^{n-2} (n-1-j) g_j^{(n)} = \\biggl(\\sum_{j=0}^{n-1} (n-j) g_j^{(n)}\\biggr) - \\sum_{j=0}^{n-1} g_j^{(n)} = B(n) - A_n.\n\\] \n\nHence \n\n\\[\nB(n) = \\frac12 \\bigl( B(n-1) + A_{n-1} + g_{n-1}^{(n-1)} \\bigr) + \\frac12 \\bigl( B(n) - A_n \\bigr).\n\\] \n\nMultiplying by 2 and using \\(A_{n-1}=A_n=\\frac12\\) gives \n\n\\[\nB(n) = B(n-1) + g_{n-1}^{(n-1)}. \\tag{7}\n\\]\n\nSince \\(B(1)=g_0^{(1)}=\\frac12\\) and \\(g_{n-1}^{(n-1)} = \\frac12 \\frac{\\binom{2n-2}{n-1}}{4^{n-1}}\\) (as shown in the previous section), iteration yields \n\n\\[\nB(n) = \\frac12 \\sum_{k=0}^{n-1} \\frac{\\binom{2k}{k}}{4^k}. \\tag{8}\n\\]\n\n---\n\n### 11. A combinatorial identity \n\n\\[\n\\sum_{k=0}^{n-1} \\frac{\\binom{2k}{k}}{4^k} = \\frac{2n}{4^n}\\binom{2n}{n}. \\tag{9}\n\\]\n\n*Proof by induction.* \nFor \\(n=1\\) both sides equal \\(1\\). Assume true for \\(n\\). Then \n\n\\[\n\\begin{aligned}\n\\sum_{k=0}^{n} \\frac{\\binom{2k}{k}}{4^k}\n&= \\frac{2n}{4^n}\\binom{2n}{n} + \\frac{\\binom{2n}{n}}{4^n} \n= \\frac{\\binom{2n}{n}}{4^n}(2n+1).\n\\end{aligned}\n\\] \n\nUsing \\(\\displaystyle \\binom{2n+2}{n+1} = \\frac{2(2n+1)}{n+1}\\binom{2n}{n}\\), the right\u2011hand side for \\(n+1\\) is \n\n\\[\n\\frac{2(n+1)}{4^{n+1}}\\binom{2n+2}{n+1}\n= \\frac{2(n+1)}{4^{n+1}}\\cdot\\frac{2(2n+1)}{n+1}\\binom{2n}{n}\n= \\frac{2n+1}{4^n}\\binom{2n}{n},\n\\] \n\nwhich matches the expression above. \u220e \n\nSubstituting (9) into (8) we obtain \n\n\\[\nB(n) = \\frac12 \\cdot \\frac{2n}{4^n}\\binom{2n}{n} = n\\,\\frac{\\binom{2n}{n}}{4^n}.\n\\] \n\nTherefore the maximal possible red sum is \n\n\\[\nR_{\\max}(n) = n - n\\,\\frac{\\binom{2n}{n}}{4^n}. \\tag{10}\n\\]\n\n---\n\n### 12. Monotonicity \n\nLet \\(a_n = \\frac{\\binom{2n}{n}}{4^n}\\). Then \\(a_{n+1}=a_n\\frac{2n+1}{2n+2}\\). Compute \n\n\\[\n\\begin{aligned}\nR_{\\max}(n+1)-R_{\\max}(n)\n&= 1 - (n+1)a_{n+1} + n a_n \\\\\n&= 1 - a_n\\frac{2n+1}{2} + n a_n \\\\\n&= 1 - \\frac{a_n}{2}\\; >\\;0 \\qquad (\\text{since } a_n<1).\n\\end{aligned}\n\\] \n\nThus \\(R_{\\max}(n)\\) is strictly increasing in \\(n\\).\n\n---\n\n### 13. Bounds for \\(a_n\\) using Wallis integrals \n\nFor \\(m\\ge 0\\) define \n\n\\[\nI_m = \\int_0^{\\pi/2} \\sin^m \\theta \\, d\\theta.\n\\] \n\nIntegration by parts yields the reduction formula \\(I_m = \\frac{m-1}{m} I_{m-2}\\) for \\(m\\ge 2\\). With \\(I_0=\\frac{\\pi}{2}\\), \\(I_1=1\\), an easy induction gives \n\n\\[\nI_{2n} = \\frac{(2n)!}{(2^n n!)^2} \\cdot \\frac{\\pi}{2}\n= a_n \\cdot \\frac{\\pi}{2},\n\\qquad\nI_{2n+1} = \\frac{2^{2n} (n!)^2}{(2n+1)!}\n= \\frac{1}{(2n+1) a_n}.\n\\] \n\nThe sequence \\(I_m\\) is strictly decreasing. Hence \\(I_{2n} > I_{2n+1} > I_{2n+2}\\).\n\n- \\(I_{2n} > I_{2n+1}\\) gives \\(\\frac{\\pi}{2}a_n > \\frac{1}{(2n+1)a_n}\\) \\(\\Longrightarrow\\) \\(a_n^2 > \\frac{2}{\\pi(2n+1)} = \\frac{1}{\\pi(n+\\frac12)}\\). \n- \\(I_{2n+1} > I_{2n+2}\\) gives \\(\\frac{1}{(2n+1)a_n} > \\frac{\\pi}{2}a_{n+1}\\). Using \\(a_{n+1}=a_n\\frac{2n+1}{2n+2}\\) this becomes \n\n\\[\n\\frac{1}{(2n+1)a_n} > \\frac{\\pi}{2}a_n\\frac{2n+1}{2n+2}\n\\;\\Longrightarrow\\;\na_n^2 < \\frac{2}{\\pi}\\cdot\\frac{2n+2}{(2n+1)^2} = \\frac{4(n+1)}{\\pi(2n+1)^2}.\n\\] \n\nNow \\(4(n+1) < \\frac{(2n+1)^2}{n}\\) because \\(4n(n+1) = 4n^2+4n < 4n^2+4n+1 = (2n+1)^2\\). Hence \\(a_n^2 < \\frac{1}{\\pi n}\\). \n\nThus we have the tight bounds \n\n\\[\n\\frac{1}{\\sqrt{\\pi\\!\\left(n+\\frac12\\right)}} \\;<\\; a_n \\;<\\; \\frac{1}{\\sqrt{\\pi n}}. \\tag{11}\n\\]\n\n---\n\n### 14. Finding the smallest \\(n\\) with \\(R_{\\max}(n)>100\\) \n\nBecause \\(R_{\\max}(n)\\) is strictly increasing, we test consecutive values. \n\n**For \\(n=105\\):** \nUsing the lower bound of (11), \n\n\\[\na_{105} > \\frac{1}{\\sqrt{\\pi\\cdot105.5}}.\n\\] \n\nNow \\(\\pi\\cdot105.5 < 3.1416\\times105.5 = 331.4388 < 441 = 21^2\\), so \\(\\sqrt{\\pi\\cdot105.5} < 21\\). Hence \n\n\\[\n\\frac{1}{\\sqrt{\\pi\\cdot105.5}} > \\frac{1}{21}.\n\\] \n\nConsequently \\(a_{105} > \\frac{1}{21}\\). Then \n\n\\[\nR_{\\max}(105) = 105(1-a_{105}) < 105\\left(1-\\frac{1}{21}\\right) = 105\\cdot\\frac{20}{21} = 100.\n\\] \n\nThus \\(R_{\\max}(105) < 100\\). \n\n**For \\(n=106\\):** \nUsing the upper bound of (11), \n\n\\[\na_{106} < \\frac{1}{\\sqrt{\\pi\\cdot106}}.\n\\] \n\nWe have \\(\\pi\\cdot106 > 3.14\\times106 = 332.84\\). Since \\(\\left(\\frac{53}{3}\\right)^2 = \\frac{2809}{9} \\approx 312.11\\), we get \\(\\sqrt{\\pi\\cdot106} > \\frac{53}{3}\\). Therefore \n\n\\[\n\\frac{1}{\\sqrt{\\pi\\cdot106}} < \\frac{3}{53}.\n\\] \n\nHence \\(a_{106} < \\frac{3}{53}\\), and \n\n\\[\nR_{\\max}(106) = 106(1-a_{106}) > 106\\left(1-\\frac{3}{53}\\right) = 106\\cdot\\frac{50}{53} = 100.\n\\] \n\nThus \\(R_{\\max}(106) > 100\\). \n\nTherefore \\(R_{\\max}(105) < 100 < R_{\\max}(106)\\), and by monotonicity \\(n=106\\) is the smallest positive integer for which one can achieve a red sum larger than \\(100\\). \n\n\\[\n\\boxed{106}\n\\]\n\n---", "average_automatic_rating": 0.96875, "human_rating": 9}}
4
+ {"question": "There are 30 colors of cards, with 70 cards of each color. Initially, 70 cards are chosen arbitrarily and stacked from top to bottom to form a pile.\n\nOne operation is defined as follows:\nFrom the bottom 20 cards, choose a card $X$ whose color does *not* appear among the top 50 cards. Then, from the top 50 cards, choose a card $Y$ whose color appears at least twice among the top 50 cards. Remove $X$ and reinsert it immediately above $Y$. Repeat this operation until it is no longer possible to select such an $X$.\n\n(1) Prove that the operation can only be performed finitely many times.\n(2) Over all possible initial configurations and choices of operations, determine the maximum possible number of operations.", "problem_idx": "CMO2025-4", "model_prediction": {"proof": "We consider the pile of \\(70\\) cards. The top \\(50\\) positions are called the *top*, the bottom \\(20\\) the *bottom*. For a colour \\(i\\) let \n\n* \\(a_i\\) = number of cards of colour \\(i\\) in the top, \n* \\(b_i\\) = number of cards of colour \\(i\\) in the bottom. \n\nThus \\(a_i+b_i\\) is the total number of cards of colour \\(i\\) in the whole pile (fixed during the process). \n\nDefine the following sets of colours: \n\n* \\(A = \\{\\,i \\mid a_i = 0,\\; b_i>0 \\,\\}\\) \u2013 colours missing from the top, \n* \\(B = \\{\\,i \\mid a_i = 1 \\,\\}\\) \u2013 colours occurring exactly once in the top, \n* \\(C = \\{\\,i \\mid a_i \\ge 2 \\,\\}\\) \u2013 colours occurring at least twice in the top. \n\nLet \\(M = |A|\\), \\(U = |B|\\), \\(V = |C|\\). \n\n---\n\n### 1. Basic observations \n\n* The top contains \\(50\\) cards, therefore \n \\[\n U + \\sum_{i\\in C} a_i = 50. \\tag{1}\n \\]\n* The bottom contains \\(20\\) cards, so \n \\[\n \\sum_{i\\in A} b_i + \\sum_{i\\notin A} b_i = 20. \\tag{2}\n \\]\n In particular each colour in \\(A\\) contributes at least one to the sum, hence \n \\[\n M \\le 20. \\tag{3}\n \\]\n* By the pigeonhole principle, with \\(50\\) cards and only \\(30\\) colours, we must have \\(V\\ge 1\\); i.e. there is always at least one colour with \\(a_i\\ge 2\\). Consequently a legal \\(Y\\) exists whenever an \\(X\\) exists. \n* The total number of colours actually present is \\(M+U+V\\). Since there are only \\(30\\) colours, \n \\[\n M+U+V \\le 30.\n \\]\n Because \\(V\\ge 1\\), we obtain the key inequality \n \\[\n M+U \\le 29. \\tag{4}\n \\]\n\n---\n\n### 2. Effect of one operation \n\nLet the chosen card \\(X\\) have colour \\(c\\) and the card \\(Y\\) have colour \\(d\\). The card that ends up at position \\(50\\) before the insertion (the *demoted* card) will be denoted by \\(D\\); its colour is called \\(e\\). \n\nFrom the description of the operation one checks that the only changes in the numbers \\(a_i,b_i\\) are: \n\n* \\(a_c\\) increases by \\(1\\) (from \\(0\\) to \\(1\\)), \\(b_c\\) decreases by \\(1\\). \n* \\(a_e\\) decreases by \\(1\\), \\(b_e\\) increases by \\(1\\). \n\nAll other colours are unchanged. \n\nWe distinguish two types of moves according to the multiplicity of the demoted colour \\(e\\) before the move: \n\n* **Type\u202f1** (the \u201cgood\u201d case): \\(a_e \\ge 2\\) (i.e. \\(e\\in C\\)). Then after the move \n * \\(M\\) decreases by \\(1\\) (colour \\(c\\) leaves \\(A\\), colour \\(e\\) stays out of \\(A\\) because \\(a_e\\) remains \\(\\ge 1\\)). \n * \\(U\\) may increase by \\(1\\) or \\(2\\) (the promoted colour \\(c\\) joins \\(B\\); if \\(a_e=2\\) then \\(e\\) moves from \\(C\\) to \\(B\\) so \\(U\\) increases by \\(2\\), otherwise \\(U\\) increases by \\(1\\)). In any case \\(U\\) does not decrease. \n\n* **Type\u202f2**: \\(a_e = 1\\) (i.e. \\(e\\in B\\)). Then \n * \\(M\\) stays the same (colour \\(c\\) leaves \\(A\\), colour \\(e\\) enters \\(A\\)). \n * \\(U\\) stays the same (colour \\(c\\) joins \\(B\\), colour \\(e\\) leaves \\(B\\)). \n\n---\n\n### 3. A useful parameter \u2013 the *suffix* of \\(B\\) \n\nSince \\(C\\neq\\varnothing\\), we can look at the rightmost card in the top that belongs to \\(C\\). Let its position be \\(p\\). All cards after position \\(p\\) are necessarily from \\(B\\) (otherwise a card of \\(C\\) would be even farther to the right). Define \n\n\\[\n\\Psi \\;=\\; \\text{number of }B\\text{-cards after the rightmost }C\\text{-card}\n \\;=\\; 50-p.\n\\]\n\nClearly \\(0\\le \\Psi \\le U\\). \n\n*If \\(\\Psi>0\\) then the last card (position \\(50\\)) is a \\(B\\)-card. Consequently the demoted colour \\(e\\) belongs to \\(B\\) and the move is of type\u202f2.* \n\nNow examine what happens to \\(\\Psi\\) during a type\u202f2 move. \n\n* The demoted card is the last card, a \\(B\\)-card, so it is one of the \\(\\Psi\\) cards that lie after the rightmost \\(C\\). \n* The promoted card becomes a \\(B\\)-card, but it is inserted **above** the chosen \\(Y\\). Since \\(Y\\) is a \\(C\\)-card and lies **not to the right** of the rightmost \\(C\\), the new \\(B\\)-card ends up **before** the rightmost \\(C\\). Hence it does **not** join the block after that \\(C\\). \n* All other \\(B\\)-cards that were after the rightmost \\(C\\) keep their relative order and remain after it, except that the last one has been removed. \n\nTherefore \\(\\Psi\\) **decreases by exactly\u202f1** in every type\u202f2 move. \n\nMoreover, as long as \\(\\Psi>0\\) the last card is a \\(B\\)-card, so the next move **must** be of type\u202f2. Hence type\u202f2 moves continue until \\(\\Psi\\) becomes \\(0\\). Once \\(\\Psi=0\\), the last card is a \\(C\\)-card and the next move will be of type\u202f1. \n\nConsequently, between two consecutive type\u202f1 moves (or before the first type\u202f1 move) the number of type\u202f2 moves is exactly the value of \\(\\Psi\\) at the beginning of that block, which is at most \\(U\\). \n\n---\n\n### 4. Upper bound on the total number of moves \n\nLet \\(M_0\\) be the initial value of \\(M\\). By (3) we have \\(M_0\\le 20\\). \n\nDuring the whole process type\u202f1 moves can occur only when \\(\\Psi=0\\) and each such move reduces \\(M\\) by exactly \\(1\\). Hence the number of type\u202f1 moves is at most \\(M_0\\) (in fact exactly \\(M_0\\) if we finally reach \\(M=0\\)). \n\nBetween type\u202f1 moves the value of \\(M\\) is constant. While \\(M=k\\) (\\(1\\le k\\le M_0\\)), the number \\(U\\) satisfies \\(U\\le 29-k\\) by (4). The block of type\u202f2 moves that occurs while \\(M=k\\) consists of at most \\(U\\) moves, therefore at most \\(29-k\\) moves. \n\nSumming over all possible values of \\(k\\) that actually appear (they are a subset of \\(\\{1,2,\\dots,M_0\\}\\)) we obtain \n\n\\[\n\\text{total moves}\n\\;\\le\\; \\bigl(\\text{number of type\u202f1 moves}\\bigr)\n \\;+\\; \\sum_{k=1}^{M_0} (29-k)\n\\;\\le\\; M_0 \\;+\\; \\sum_{k=1}^{M_0} (29-k).\n\\]\n\nBecause \\(M_0\\le 20\\), the right\u2011hand side is maximised when \\(M_0=20\\), giving \n\n\\[\n20 \\;+\\; \\sum_{k=1}^{20} (29-k)\n\\;=\\; 20 \\;+\\; \\bigl(29\\cdot20 - \\tfrac{20\\cdot21}{2}\\bigr)\n\\;=\\; 20 \\;+\\; (580-210)\n\\;=\\; 390.\n\\]\n\nThus **no sequence of operations can exceed 390**. In particular the operation can be performed only finitely many times, proving part (1). \n\n---\n\n### 5. Construction attaining 390 moves \n\nWe now exhibit an initial configuration and a strategy that achieves exactly \\(390\\) operations. \n\n* **Colours.** Use all \\(30\\) colours. Fix one colour, say colour \\(1\\), to be the unique \\(C\\)-colour; it will always satisfy \\(a_1\\ge 2\\). The remaining \\(29\\) colours will alternate between \\(A\\) and \\(B\\). \n* **Initial numbers.** \n * Let \\(a_1 = 41\\), \\(b_1 = 0\\). \n * Choose \\(9\\) distinct colours to be initially in \\(B\\). For each of them set \\(a_i = 1\\), \\(b_i = 0\\). \n * The other \\(20\\) colours are initially in \\(A\\). For each of them set \\(a_i = 0\\), \\(b_i = 1\\). \n Check: top total \\(41+9 = 50\\), bottom total \\(20\\), all cards sum to \\(70\\). \n\n* **Initial order in the top.** \n Place all \\(41\\) cards of colour \\(1\\) first, then the \\(9\\) cards of the \\(B\\)-colours (in any order). Thus the rightmost card is a \\(B\\)-card, so initially \\(\\Psi = 9\\). \n\n* **Strategy.** \n We will repeatedly execute the following *round* while \\(M>0\\): \n\n 1. **Phase\u202f2 (type\u202f2 moves).** As long as the rightmost card is a \\(B\\)-card (i.e. \\(\\Psi>0\\)), perform a move choosing \n * \\(X\\): any card from the bottom whose colour is in \\(A\\) (there are always \\(M\\) such cards), \n * \\(Y\\): the **rightmost** card of colour \\(1\\) (i.e. the rightmost \\(C\\)-card). \n This is a type\u202f2 move; it promotes the chosen \\(A\\)-colour to \\(B\\) and demotes the last \\(B\\)-card. By the analysis, after each such move \\(\\Psi\\) decreases by \\(1\\) while \\(M\\) and \\(U\\) stay constant. \n\n 2. **Phase\u202f1 (type\u202f1 move).** When \\(\\Psi\\) becomes \\(0\\), the last card is colour \\(1\\). Now perform one move with \n * \\(X\\): any card from the bottom whose colour is in \\(A\\) (still \\(M\\) of them), \n * \\(Y\\): again the rightmost card of colour \\(1\\) (which is the last card). \n This is a type\u202f1 move: it promotes the chosen \\(A\\)-colour to \\(B\\) and demotes one colour\u2011\\(1\\) card. Consequently \n * \\(M\\) decreases by \\(1\\), \n * \\(U\\) increases by \\(1\\) (the demoted colour\u2011\\(1\\) card stays in \\(C\\) because \\(a_1\\) was at least \\(2\\)), \n * the number of colour\u2011\\(1\\) cards in the top, \\(a_1\\), decreases by \\(1\\). \n\n After this move one checks that the top order again consists of all remaining colour\u2011\\(1\\) cards (now \\(a_1\\) of them) followed by all \\(U\\) \\(B\\)-cards, with the last card being a \\(B\\)-card, i.e. \\(\\Psi = U\\). \n\nThus after each round the parameters change as \n\n\\[\n(M,\\,U,\\,a_1) \\;\\longrightarrow\\; (M-1,\\, U+1,\\, a_1-1),\n\\]\n\nand the invariant \u201ctop = (colour\u202f1 repeated \\(a_1\\) times) followed by (all \\(B\\)-cards)\u201d is restored, with \\(\\Psi = U\\). \n\nStart with \\((M,U,a_1) = (20,9,41)\\). The process goes through the values \n\n\\[\n\\begin{array}{c|ccc}\n\\text{round} & M & U & a_1 \\\\ \\hline\n\\text{start} & 20 & 9 & 41 \\\\\n\\text{after 1st round} & 19 & 10 & 40 \\\\\n\\text{after 2nd round} & 18 & 11 & 39 \\\\\n\\vdots & \\vdots & \\vdots & \\vdots \\\\\n\\text{after 20th round} & 0 & 29 & 21\n\\end{array}\n\\]\n\nIn the round where \\(M = k\\) (\\(k\\) runs from \\(20\\) down to \\(1\\)) we perform exactly \\(U\\) type\u202f2 moves, where \\(U = 29-k\\) (because before the round \\(M=k\\) and \\(U = 29-M = 29-k\\)), followed by one type\u202f1 move. \n\nTotal number of operations =\n\n\\[\n\\sum_{k=1}^{20} (29-k) \\;+\\; 20 \\;=\\; (9+10+\\cdots+28) + 20 \\;=\\; 370 + 20 \\;=\\; 390.\n\\]\n\nAfter the last type\u202f1 move we obtain \\(M=0\\); no \\(X\\) exists, so the process stops. \n\nHence **390 operations are achievable**, and together with the upper bound this is the maximum possible number.\n\n---", "average_automatic_rating": 1.0, "human_rating": 21}}
5
+ {"question": "Find all real numbers $\\lambda$ such that there exists a positive integer $N$ with the following property:\n for every integer $n \\ge N$ and for all non-negative real numbers\n $x_1, x_2, \\ldots, x_n$ whose sum is 1, the inequality\n\n$$\n\\left( \\sum_{1\\le i<j\\le n} x_i x_j \\right)^2 \\le \\lambda \\sum_{1\\le i<j<k\\le n} x_i x_j x_k + \\frac{1}{n}\\sum_{1\\le i<j\\le n} (x_i - x_j)^2\n$$\n\nalways holds.", "problem_idx": "CMO2025-5", "model_prediction": {"proof": "**Notation.** \nFor a given integer \\(n \\ge 3\\) and non\u2011negative real numbers \\(x_1,\\dots,x_n\\) with \\(\\sum_{i=1}^n x_i = 1\\) we define \n\n\\[\nS = \\sum_{1\\le i<j\\le n} x_i x_j,\\qquad \nT = \\sum_{1\\le i<j<k\\le n} x_i x_j x_k,\\qquad \nV = \\sum_{i=1}^n \\Bigl(x_i-\\frac1n\\Bigr)^2 .\n\\]\n\nNotice that \n\n\\[\n\\sum_{1\\le i<j\\le n} (x_i-x_j)^2 = n\\sum_{i=1}^n x_i^2 -1 = nB-1,\n\\] \n\nwhere \\(B = \\sum_{i=1}^n x_i^2\\). Hence \n\n\\[\n\\frac1n\\sum_{1\\le i<j\\le n} (x_i-x_j)^2 = B-\\frac1n = V.\n\\]\n\nThus the inequality in the problem becomes \n\n\\[\nS^2 \\;\\le\\; \\lambda\\, T \\;+\\; V. \\tag{0}\n\\]\n\n**Useful relations.** \nBecause \\(\\sum x_i =1\\) we have \n\n\\[\nS = \\frac{1-B}{2},\\qquad \nT = \\frac{1-3B+2C}{6},\n\\] \n\nwhere \\(C = \\sum_{i=1}^n x_i^3\\). \nThe equality \\(V = B-\\frac1n\\) has already been used.\n\n---\n\n### Lemma\n\nFor every \\(n\\ge 3\\) and every admissible \\((x_i)\\) the inequality \n\n\\[\nS^2 \\;\\le\\; \\frac32\\cdot\\frac{n-1}{n-2}\\; T \\;+\\; V \\tag{1}\n\\]\n\nholds. \n\n*Proof.* \nSet \\(c_n = \\dfrac32\\cdot\\dfrac{n-1}{n-2}\\). Substituting the expressions for \\(S,T,V\\) into (1) and multiplying by \\(12\\) gives \n\n\\[\n3(1-B)^2 \\;\\le\\; 2c_n\\,(1-3B+2C) \\;+\\; 12\\Bigl(B-\\frac1n\\Bigr).\n\\]\n\nSince \\(2c_n = \\dfrac{3(n-1)}{n-2}\\), after dividing by \\(3\\) we obtain \n\n\\[\n1-6B+B^2+\\frac4n \\;\\le\\; \\frac{n-1}{n-2}\\,(1-3B+2C).\n\\]\n\nMultiplying by \\(n-2\\) and rearranging yields \n\n\\[\n-(n-2)B^2 + 3(n-3)B + 2(n-1)C -3 + \\frac8n \\;\\ge\\; 0,\n\\] \n\nor equivalently \n\n\\[\n2(n-1)C \\;\\ge\\; (n-2)B^2 - 3(n-3)B + 3 - \\frac8n. \\tag{2}\n\\]\n\nWe now prove (2). \n\n1. **A lower bound for \\(C\\).** \n By the Cauchy\u2013Schwarz inequality \n\n \\[\n \\biggl(\\sum_{i=1}^n x_i^2\\biggr)^{\\!2}\n = \\biggl(\\sum_{i=1}^n \\sqrt{x_i}\\cdot x_i^{3/2}\\biggr)^{\\!2}\n \\le \\biggl(\\sum_{i=1}^n x_i\\biggr)\\biggl(\\sum_{i=1}^n x_i^3\\biggr)\n = 1\\cdot C.\n \\] \n\n Hence \n\n \\[\n C \\;\\ge\\; B^2. \\tag{3}\n \\]\n\n2. **A quadratic estimate.** \n From (3) we have \\(2(n-1)C \\ge 2(n-1)B^2\\). Therefore it suffices to show \n\n \\[\n 2(n-1)B^2 \\;\\ge\\; (n-2)B^2 - 3(n-3)B + 3 - \\frac8n,\n \\] \n\n i.e. \n\n \\[\n nB^2 + 3(n-3)B - 3 + \\frac8n \\;\\ge\\; 0. \\tag{4}\n \\]\n\n The number \\(B\\) satisfies \\(B\\ge \\frac1n\\) (by \\(\\bigl(\\sum x_i\\bigr)^2 \\le n\\sum x_i^2\\)) and \\(B\\le 1\\). \n Define \\(Q(B)= nB^2 + 3(n-3)B - 3 + \\frac8n\\). Then \n\n \\[\n Q\\Bigl(\\frac1n\\Bigr)\n = n\\cdot\\frac1{n^2} + 3(n-3)\\cdot\\frac1n - 3 + \\frac8n\n = \\frac1n + \\frac{3(n-3)}{n} - 3 + \\frac8n\n = \\frac{3n}{n} - 3 = 0.\n \\] \n\n Moreover, \\(Q'(B)=2nB+3(n-3)\\). For \\(B\\ge \\frac1n\\), \n\n \\[\n Q'(B)\\;\\ge\\; 2n\\cdot\\frac1n + 3(n-3) = 2+3(n-3) >0\\quad\\text{for } n\\ge 3.\n \\] \n\n Hence \\(Q\\) is strictly increasing on \\(\\bigl[\\frac1n,1\\bigr]\\) and therefore \\(Q(B)\\ge 0\\) there. \n This proves (4) and consequently (2). Thus (1) is established. \u220e\n\n---\n\n### Necessity of \\(\\lambda > \\frac32\\)\n\nAssume that for some \\(\\lambda\\) there exists an integer \\(N\\) such that (0) holds for all \\(n\\ge N\\) and all admissible \\((x_i)\\). \nIn particular, for every \\(n\\ge N\\) the **equal** distribution \\(x_i=\\frac1n\\) must satisfy (0). \nFor this choice we have \\(V=0\\), \\(B=\\frac1n\\), \\(C=\\frac1{n^2}\\), so that \n\n\\[\nS = \\frac{1-\\frac1n}{2},\\qquad\nT = \\frac{1-\\frac3n+\\frac2{n^2}}{6}.\n\\]\n\nInequality (0) becomes \n\n\\[\n\\frac{(1-\\frac1n)^2}{4} \\;\\le\\; \\lambda\\,\\frac{1-\\frac3n+\\frac2{n^2}}{6},\n\\] \n\nwhich after simplification yields \n\n\\[\n\\lambda \\;\\ge\\; \\frac32\\cdot\\frac{n-1}{n-2}. \\tag{5}\n\\]\n\nThe right\u2011hand side of (5) is strictly larger than \\(\\frac32\\) for every finite \\(n\\ge 3\\) because \n\n\\[\n\\frac{n-1}{n-2} = 1+\\frac{1}{n-2} > 1.\n\\]\n\nIf \\(\\lambda \\le \\frac32\\), then for **any** \\(N\\) we can take \\(n=N\\) (if \\(N\\ge 3\\)) and (5) fails; if \\(N\\le 2\\) we may take \\(n=3\\ge N\\) and again (5) fails. Hence no such \\(N\\) exists. Therefore a necessary condition is \\(\\lambda > \\frac32\\).\n\n---\n\n### Sufficiency of \\(\\lambda > \\frac32\\)\n\nLet \\(\\lambda > \\frac32\\) be fixed. Consider the sequence \n\n\\[\na_n = \\frac32\\cdot\\frac{n-1}{n-2},\\qquad n\\ge 3.\n\\]\n\nIt is decreasing and \\(\\displaystyle\\lim_{n\\to\\infty} a_n = \\frac32\\). \nBecause \\(\\lambda > \\frac32\\), there exists an integer \\(N\\ge 3\\) such that \\(a_n \\le \\lambda\\) for all \\(n\\ge N\\). \n(Explicitly, choose \\(N\\) large enough so that \\(a_N \\le \\lambda\\); then because the sequence decreases, \\(a_n \\le a_N \\le \\lambda\\) for all \\(n\\ge N\\).)\n\nNow take any \\(n\\ge N\\) and any admissible \\((x_i)\\). By Lemma (inequality (1)) we have \n\n\\[\nS^2 \\;\\le\\; a_n\\, T \\;+\\; V.\n\\] \n\nSince \\(a_n \\le \\lambda\\), it follows that \n\n\\[\nS^2 \\;\\le\\; \\lambda\\, T \\;+\\; V,\n\\] \n\nwhich is exactly (0). Thus the required property holds for this \\(N\\).\n\n---\n\n### Conclusion\n\nThe real numbers \\(\\lambda\\) for which there exists a positive integer \\(N\\) with the stated property are precisely \n\n\\[\n\\boxed{\\lambda > \\dfrac32}.\n\\]", "average_automatic_rating": 1.0, "human_rating": 18}}
6
+ {"question": "Given an odd integer $n > 1$. It is known that every prime divisor $p$ of $n$ satisfies $\\gcd(p - 1, n) = 1$. Determine the number of triples $(a, b, c)$ satisfying the following two conditions:\n\n(1) $a, b, c \\in {1, 2, \\dots, n}$, and $\\gcd(a, b, c, n) = 1$\n\n(2) There exists a permutation $x_1, x_2, \\dots, x_n$ of $1, 2, \\dots, n$ such that for every $1 \\le k \\le n$,\n\n$$\nn \\mid a x_{k+2} + b x_{k+1} + c x_k,\n$$\nwhere the indices are interpreted modulo $n$.", "problem_idx": "CMO2025-6", "model_prediction": {"proof": "### 1. Reformulation \nWe work in the ring \\(\\mathbb{Z}/n\\mathbb{Z}\\), identifying the set \\(\\{1,2,\\dots,n\\}\\) with its residues (with \\(n\\) identified with \\(0\\)). A permutation of this set corresponds to a bijection \\(f:\\mathbb{Z}/n\\mathbb{Z}\\to\\mathbb{Z}/n\\mathbb{Z}\\). Condition (2) becomes \n\n\\[\na\\,f(k+2)+b\\,f(k+1)+c\\,f(k)\\equiv0\\pmod n\\qquad(\\forall k\\in\\mathbb{Z}/n\\mathbb{Z}). \\tag{1}\n\\]\n\nWe also have \\(\\gcd(a,b,c,n)=1\\).\n\n### 2. Invertibility of \\(a\\) \nAssume, for a contradiction, that a prime \\(p\\mid n\\) also divides \\(a\\). Reduce (1) modulo \\(p\\) and denote \\(y_k=f(k)\\bmod p\\). Because \\(f\\) is a bijection, the multiset \\(\\{y_k\\}\\) contains each element of \\(\\mathbb{F}_p\\) exactly \\(n/p\\) times (the reduction map \\(\\mathbb{Z}/n\\mathbb{Z}\\to\\mathbb{F}_p\\) is \\(n/p\\)-to\u20111).\n\n* **Case 1:** \\(p\\nmid b\\). \n Then \\(b\\) is invertible modulo \\(p\\). Let \\(\\lambda\\equiv -c b^{-1}\\pmod p\\). \n \u2013 If \\(p\\mid c\\), then \\(\\lambda=0\\) and (2) gives \\(b y_{k+1}\\equiv0\\), hence \\(y_{k+1}\\equiv0\\) for all \\(k\\), contradicting the presence of non\u2011zero residues. \n \u2013 If \\(p\\nmid c\\), then \\(\\lambda\\neq0\\) and (2) simplifies to \\(y_{k+1}\\equiv\\lambda y_k\\). Inductively \\(y_k\\equiv\\lambda^{k}y_0\\). Periodicity \\(y_{k+n}=y_k\\) forces \\(\\lambda^{n}y_0\\equiv y_0\\); since some \\(y_k\\) is non\u2011zero, \\(\\lambda^{n}\\equiv1\\). The order of \\(\\lambda\\) divides \\(p-1\\), and \\(\\gcd(p-1,n)=1\\) implies \\(\\lambda=1\\). Then \\(y_{k+1}\\equiv y_k\\) for all \\(k\\), so all \\(y_k\\) are equal \u2013 impossible for a uniform distribution over \\(p>1\\) residues.\n\n* **Case 2:** \\(p\\mid b,\\ p\\nmid c\\). \n Then (2) reduces to \\(c y_k\\equiv0\\), hence \\(y_k\\equiv0\\) for all \\(k\\), contradiction.\n\n* **Case 3:** \\(p\\mid b\\) and \\(p\\mid c\\). \n Then \\(p\\) divides \\(a,b,c,n\\), contradicting \\(\\gcd(a,b,c,n)=1\\).\n\nThus no prime divisor of \\(n\\) divides \\(a\\); consequently \\(\\gcd(a,n)=1\\) and \\(a\\) is invertible modulo \\(n\\).\n\n### 3. Reduction to a monic recurrence \nSince \\(a\\) is invertible, set \n\n\\[\nu\\equiv -a^{-1}b,\\qquad v\\equiv -a^{-1}c\\pmod n.\n\\]\n\nEquation (1) becomes \n\n\\[\nf(k+2)\\equiv u\\,f(k+1)+v\\,f(k)\\pmod n\\qquad(\\forall k). \\tag{3}\n\\]\n\nThe mapping \\((a,b,c)\\mapsto (a,u,v)\\) is a bijection between triples with \\(\\gcd(a,b,c,n)=1\\) and triples with \\(a\\in(\\mathbb{Z}/n\\mathbb{Z})^\\times,\\ u,v\\in\\mathbb{Z}/n\\mathbb{Z}\\). (If \\(a\\) is invertible, then \\(b=-au,\\ c=-av\\) and \\(\\gcd(a,b,c,n)=\\gcd(a,n)=1\\).) Hence the number of admissible triples equals \n\n\\[\n\\varphi(n)\\;\\times\\; H(n),\n\\]\n\nwhere \\(H(n)\\) denotes the number of pairs \\((u,v)\\in(\\mathbb{Z}/n\\mathbb{Z})^2\\) for which there exists a permutation satisfying (3).\n\n### 4. Necessary conditions modulo each prime divisor \nFix a prime \\(p\\mid n\\) and reduce (3) modulo \\(p\\). Write \\(u_p=u\\bmod p,\\ v_p=v\\bmod p,\\ y_k=f(k)\\bmod p\\). Then \n\n\\[\ny_{k+2}\\equiv u_p\\,y_{k+1}+v_p\\,y_k\\pmod p. \\tag{4}\n\\]\n\nThe uniform distribution of the residues \\(\\{y_k\\}\\) (each appears \\(n/p\\) times) remains valid.\n\n**Step A: \\(v_p\\neq0\\).** \nAssume \\(v_p=0\\). Then (4) gives \\(y_{k+2}\\equiv u_p y_{k+1}\\). \n\n- If \\(u_p=0\\), then \\(y_{k+2}\\equiv0\\) forces all \\(y_k\\) zero, contradiction. \n- If \\(u_p\\neq0\\), solve the recurrence. From \\(y_{k+2}=u_p y_{k+1}\\) we get for \\(k\\ge0\\): \\(y_{k+1}=u_p^{k}y_1\\). Periodicity \\(y_n=y_0,\\ y_{n+1}=y_1\\) yields \n \\[\n u_p^{n-1}y_1=y_0,\\qquad y_1=u_p y_0.\n \\] \n Combining gives \\(y_0=u_p^n y_0\\). If \\(y_0\\equiv0\\) then \\(y_1\\equiv0\\) and all \\(y_k\\equiv0\\), contradiction; thus \\(y_0\\not\\equiv0\\) and \\(u_p^n\\equiv1\\). Since \\(u_p\\in\\mathbb{F}_p^\\times\\), its order divides \\(p-1\\); with \\(\\gcd(p-1,n)=1\\) we get \\(u_p=1\\). Then the recurrence forces \\(y_{k+2}=y_{k+1}\\), hence all \\(y_k\\) are equal, again contradicting uniformity. Therefore \\(v_p\\neq0\\).\n\n**Step B: The companion matrix.** \nDefine \n\n\\[\nM_p=\\begin{pmatrix}0&1\\\\ v_p&u_p\\end{pmatrix}\\in\\operatorname{GL}_2(\\mathbb{F}_p),\\qquad s_k=(y_k,y_{k+1})^{\\!\\top}.\n\\]\n\nThen \\(s_{k+1}=M_p s_k\\). Because the sequence is \\(n\\)-periodic, \\(s_n=s_0\\), i.e. \\(M_p^n s_0=s_0\\). Let \\(\\tau\\) be the order of \\(s_0\\) under the action of \\(M_p\\) (smallest \\(t>0\\) with \\(M_p^t s_0=s_0\\)). Then \\(\\tau\\mid n\\).\n\nThe multiset \\(\\{y_k\\}\\) consists of \\(n/\\tau\\) repetitions of the \\(\\tau\\) values \\(y_0,\\dots,y_{\\tau-1}\\). Uniformity implies that in one \\(\\tau\\)-block each residue appears exactly \\(\\tau/p\\) times; in particular \\(p\\mid\\tau\\). Since \\(\\tau\\) divides \\(\\operatorname{ord}(M_p)\\), we have \\(p\\mid\\operatorname{ord}(M_p)\\).\n\nNow classify the possible Jordan forms of \\(M_p\\) over \\(\\mathbb{F}_p\\):\n\n* **Distinct eigenvalues in \\(\\mathbb{F}_p\\).** Then \\(M_p\\) is diagonalizable, its eigenvalues lie in \\(\\mathbb{F}_p^\\times\\), and their orders divide \\(p-1\\). Hence \\(\\operatorname{ord}(M_p)\\mid p-1\\), contradicting \\(p\\mid\\operatorname{ord}(M_p)\\).\n* **Irreducible characteristic polynomial.** The eigenvalues lie in \\(\\mathbb{F}_{p^2}^\\times\\); their orders divide \\(p^2-1\\), which is coprime to \\(p\\). So \\(\\operatorname{ord}(M_p)\\) is coprime to \\(p\\), contradiction.\n* **Double eigenvalue \\(\\lambda\\in\\mathbb{F}_p^\\times\\) (since \\(v_p\\neq0\\)).** Then \\(u_p=2\\lambda,\\ v_p=-\\lambda^2\\), and \\(M_p\\) is not diagonalizable (it is conjugate to a Jordan block). One checks that \\(\\operatorname{ord}(M_p)=p\\cdot\\operatorname{ord}(\\lambda)\\). A vector that is not an eigenvector has orbit size exactly \\(p\\cdot\\operatorname{ord}(\\lambda)\\); an eigenvector has orbit size dividing \\(\\operatorname{ord}(\\lambda)\\).\n\nBecause \\(p\\mid\\operatorname{ord}(M_p)\\), the only possible case is the double eigenvalue one. Moreover, \\(\\tau\\) is a multiple of \\(p\\), so \\(s_0\\) cannot be an eigenvector (otherwise its orbit size would divide \\(\\operatorname{ord}(\\lambda)\\), which is coprime to \\(p\\)). Hence \\(\\tau=\\operatorname{ord}(M_p)=p\\cdot d\\) where \\(d=\\operatorname{ord}(\\lambda)\\).\n\nNow \\(\\tau\\mid n\\) and \\(d\\mid p-1\\). Since \\(\\gcd(p-1,n)=1\\), we must have \\(d=1\\), i.e. \\(\\lambda=1\\). Consequently \n\n\\[\nu_p\\equiv2\\pmod p,\\qquad v_p\\equiv-1\\pmod p. \\tag{5}\n\\]\n\nThus for every prime divisor \\(p\\) of \\(n\\), (5) holds.\n\n### 5. Chinese Remainder Theorem decomposition \nWrite \\(n=\\prod_{p\\mid n}p^{e_p}\\). By the CRT, \n\n\\[\n\\mathbb{Z}/n\\mathbb{Z}\\cong\\prod_{p\\mid n}R_p,\\qquad R_p=\\mathbb{Z}/p^{e_p}\\mathbb{Z}.\n\\]\n\nUnder this isomorphism, \\(u\\) and \\(v\\) correspond to tuples \\((u_p)_{p\\mid n},(v_p)_{p\\mid n}\\) with \\(u_p,v_p\\in R_p\\) satisfying the congruences (5). \n\nSuppose \\(f:\\mathbb{Z}/n\\mathbb{Z}\\to\\mathbb{Z}/n\\mathbb{Z}\\) is a bijection satisfying (3). For each \\(p\\), let \\(f_p(k)\\) be the projection of \\(f(k)\\) to \\(R_p\\). Then (3) splits componentwise: \n\n\\[\nf_p(k+2)=u_p\\,f_p(k+1)+v_p\\,f_p(k)\\quad\\text{in }R_p. \\tag{6}\n\\]\n\nDefine the matrix \n\n\\[\nM_p=\\begin{pmatrix}0&1\\\\ v_p&u_p\\end{pmatrix}\\in\\operatorname{GL}_2(R_p).\n\\]\n\nWe will show later (Lemma\u202f1) that \\(M_p^{\\,p^{e_p}}=I\\) for any such lifts. Consequently, from the recurrence we obtain \\(f_p(k+p^{e_p})=f_p(k)\\), so \\(f_p\\) is periodic with period dividing \\(p^{e_p}\\). Hence \\(f_p\\) factors through \\(\\mathbb{Z}/p^{e_p}\\mathbb{Z}\\): there exists a function \\(g_p:\\mathbb{Z}/p^{e_p}\\mathbb{Z}\\to R_p\\) such that \\(f_p(k)=g_p(k\\bmod p^{e_p})\\), and \\(g_p\\) satisfies (6) on the cyclic group of order \\(p^{e_p}\\).\n\nBecause \\(f\\) is a bijection, the map \n\n\\[\nk\\longmapsto\\bigl(g_p(k\\bmod p^{e_p})\\bigr)_{p\\mid n}\n\\]\n\nis a bijection from \\(\\mathbb{Z}/n\\mathbb{Z}\\) to \\(\\prod_{p\\mid n}R_p\\). Using the CRT bijection \\(\\mathbb{Z}/n\\mathbb{Z}\\cong\\prod_{p\\mid n}\\mathbb{Z}/p^{e_p}\\mathbb{Z}\\), this is equivalent to the map \n\n\\[\nG:\\prod_{p\\mid n}\\mathbb{Z}/p^{e_p}\\mathbb{Z}\\longrightarrow\\prod_{p\\mid n}R_p,\\qquad G\\bigl((i_p)_p\\bigr)=\\bigl(g_p(i_p)\\bigr)_p\n\\]\n\nbeing bijective. Since both sets have the same finite cardinality, bijectivity of \\(G\\) forces each \\(g_p\\) to be injective (if two inputs differ only in the \\(p\\)-th coordinate, their images would coincide). Hence each \\(g_p\\) is a bijection from \\(\\mathbb{Z}/p^{e_p}\\mathbb{Z}\\) onto \\(R_p\\) (both of size \\(p^{e_p}\\)). \n\nConversely, given for each \\(p\\) a bijection \\(g_p:R_p\\to R_p\\) satisfying (6), defining \\(f\\) via the CRT yields a global bijection satisfying (3). Therefore the existence of a global permutation is equivalent to the existence, for each prime power factor \\(p^{e_p}\\), of a bijection of \\(R_p\\) satisfying (6) with the given \\(u_p,v_p\\). Consequently \n\n\\[\nH(n)=\\prod_{p\\mid n}H(p^{e_p}),\n\\]\n\nwhere \\(H(p^{e})\\) denotes the number of pairs \\((u,v)\\in R=\\mathbb{Z}/p^{e}\\mathbb{Z}\\) with \\(u\\equiv2,\\ v\\equiv-1\\pmod p\\) for which such a bijection exists.\n\n### 6. Analysis for a prime power modulus \nFix a prime \\(p\\) (odd) and an exponent \\(e\\ge1\\). Let \\(R=\\mathbb{Z}/p^{e}\\mathbb{Z}\\). We consider \\(u,v\\in R\\) satisfying \n\n\\[\nu=2+pU,\\qquad v=-1+pV,\n\\]\n\nwith \\(U,V\\in R\\) (when \\(e=1\\) there is no free choice \u2013 the pair is uniquely \\((2,-1)\\)). Define \n\n\\[\nM=\\begin{pmatrix}0&1\\\\ v&u\\end{pmatrix},\\qquad N=M-I.\n\\]\n\nUsing \\(M^2=uM+vI\\) we compute \n\n\\[\nN^2=(u-2)M+(v+1)I = p(UM+VI). \\tag{7}\n\\]\n\nHence \\(N^2\\) is divisible by \\(p\\). Moreover, modulo \\(p\\) we have \\(M\\equiv J=\\begin{pmatrix}0&1\\\\-1&2\\end{pmatrix}\\) and \\(N\\equiv J-I\\neq0\\).\n\n**Lemma 1.** For any such \\(M\\), \\(M^{\\,p^{e}}=I\\) in \\(R\\).\n\n*Proof.* Induction on \\(\\beta\\) shows \\(M^{\\,p^{\\beta}}=I+p^{\\beta}A_{\\beta}\\) for some matrix \\(A_{\\beta}\\). For \\(\\beta=e\\), the term \\(p^{e}A_e=0\\) in \\(R\\), so \\(M^{\\,p^{e}}=I\\). The details are supplied in the cases below. \u220e\n\nThe decisive point is to determine when the order of \\(M\\) is exactly \\(p^{e}\\). We treat \\(p>3\\) and \\(p=3\\) separately.\n\n#### 6.1. The case \\(p>3\\) \n\n**Proposition 2.** For \\(p>3\\), every lift \\((U,V)\\) yields \\(\\operatorname{ord}(M)=p^{e}\\).\n\n*Proof.* We prove by induction on \\(\\beta\\ (1\\le\\beta\\le e)\\) that \n\n\\[\nM^{\\,p^{\\beta}} = I + p^{\\beta} N_{\\beta},\\qquad N_{\\beta}\\bmod p\\neq0. \\tag{8}\n\\]\n\n*Base \\(\\beta=1\\):* Expand \\(M^p=(I+N)^p\\): \n\n\\[\nM^p = I + pN + \\sum_{k=2}^{p-1}\\binom{p}{k}N^{k} + N^{p}.\n\\]\n\nFrom (7), \\(N^2=pQ\\). For \\(k\\ge2\\), write \\(N^{k}=N^{k-2}N^{2}=p N^{k-2}Q\\). Hence each term \\(\\binom{p}{k}N^{k}\\) contains at least two factors of \\(p\\) (one from \\(\\binom{p}{k}\\) for \\(2\\le k\\le p-1\\) and one from \\(N^{k}\\)). For \\(k=p\\), \\(N^{p}=N(N^2)^{(p-1)/2}=N(pQ)^{(p-1)/2}=p^{(p-1)/2}N Q^{(p-1)/2}\\); since \\(p>3\\), \\((p-1)/2\\ge2\\), so this term is also divisible by \\(p^2\\). Thus \n\n\\[\nM^p = I + pN + p^2 S = I + p N_1,\n\\] \nwith \\(N_1\\equiv N\\pmod p\\neq0\\).\n\n*Inductive step:* Assume (8) holds for some \\(\\beta<e\\). Then \n\n\\[\nM^{\\,p^{\\beta+1}} = (I+p^{\\beta}N_{\\beta})^{p}=I + p\\cdot p^{\\beta}N_{\\beta} + \\sum_{k=2}^{p}\\binom{p}{k}p^{\\beta k}N_{\\beta}^{k}.\n\\] \nThe linear term is \\(p^{\\beta+1}N_{\\beta}\\). For \\(k\\ge2\\), the exponent of \\(p\\) in the term is at least \\(1+\\beta k\\) (for \\(2\\le k\\le p-1\\)) or \\(\\beta p\\) (for \\(k=p\\)). Because \\(\\beta\\ge1\\) and \\(p\\ge5\\), one checks that these exponents are \\(\\ge\\beta+2\\). Hence all higher terms are multiples of \\(p^{\\beta+2}\\). Therefore \n\n\\[\nM^{\\,p^{\\beta+1}} = I + p^{\\beta+1}N_{\\beta} + p^{\\beta+2}T = I + p^{\\beta+1}N_{\\beta+1},\n\\] \nwith \\(N_{\\beta+1}=N_{\\beta}+pT\\). Since \\(N_{\\beta}\\bmod p\\neq0\\), also \\(N_{\\beta+1}\\bmod p\\neq0\\).\n\nNow take \\(\\beta=e-1\\) in (8): \\(M^{\\,p^{e-1}} = I + p^{e-1}N_{e-1}\\neq I\\) because \\(p^{e-1}N_{e-1}\\neq0\\) in \\(R\\). With Lemma\u202f1 (\\(M^{\\,p^{e}}=I\\)) we conclude \\(\\operatorname{ord}(M)=p^{e}\\). \u220e\n\n#### 6.2. The case \\(p=3\\) \n\nNow \\(p=3\\). Write \\(u=2+3U,\\ v=-1+3V\\).\n\n**Proposition 3.** For \\(p=3\\): \n\n* If \\(e=1\\), then necessarily \\((u,v)=(2,2)\\) and \\(\\operatorname{ord}(M)=3\\). \n* If \\(e\\ge2\\), then \\(\\operatorname{ord}(M)=3^{e}\\) iff \\(U+V\\not\\equiv2\\pmod3\\). When \\(U+V\\equiv2\\pmod3\\), the order divides \\(3^{e-1}\\) (so is strictly smaller).\n\n*Proof.* Compute \\(M^3\\) using \\(M^2=uM+vI\\): \n\n\\[\nM^3 = (u^2+v)M + uv I.\n\\]\n\nSubstituting the expressions for \\(u,v\\):\n\n\\[\n\\begin{aligned}\nu^2+v &= 3(1+4U+V) + 9U^2, \\\\\nuv &= -2 + 3(2V-U) + 9UV.\n\\end{aligned}\n\\]\n\nHence \n\n\\[\nM^3 = I + 3T + 9S,\n\\] \n\nwith \n\n\\[\nT = (1+4U+V)M + (-1+2V-U)I,\\qquad S = U^2M + UV I.\n\\]\n\nReducing modulo \\(3\\): \n\\(1+4U+V\\equiv1+U+V\\), \\(-1+2V-U\\equiv -(1+U+V)\\pmod3\\). Thus \n\n\\[\nT \\equiv (1+U+V)(M-I)\\pmod3. \\tag{9}\n\\]\n\n* **Case 1:** \\(U+V\\not\\equiv2\\pmod3\\), i.e., \\(1+U+V\\not\\equiv0\\pmod3\\). \n Then \\(T\\bmod3\\) is a non\u2011zero scalar times \\(M-I\\), and since \\(M-I\\bmod3\\neq0\\), \\(T\\) is not divisible by \\(3\\). So \\(M^3 = I + 3T\\) with \\(T\\bmod3\\neq0\\). \n\n An induction analogous to the one for \\(p>3\\) (but now with base \\(M^3=I+3T\\)) shows that for all \\(1\\le\\beta\\le e\\), \n\n \\[\n M^{\\,3^{\\beta}} = I + 3^{\\beta} T_{\\beta},\\qquad T_{\\beta}\\bmod3\\neq0.\n \\] \n\n For \\(\\beta=e-1\\) we obtain \\(M^{\\,3^{e-1}}\\neq I\\), while \\(M^{\\,3^{e}}=I\\) by Lemma\u202f1, hence \\(\\operatorname{ord}(M)=3^{e}\\).\n\n* **Case 2:** \\(U+V\\equiv2\\pmod3\\), i.e., \\(1+U+V\\equiv0\\pmod3\\). \n Then (9) shows that \\(T\\) is divisible by \\(3\\); write \\(T=3T'\\). Then \n\n \\[\n M^3 = I + 9T' + 9S = I + 9L,\\qquad L = T' + S.\n \\] \n\n Now one proves by induction that \\((I+9L)^{\\,3^{m}}\\equiv I\\pmod{3^{m+2}}\\). Taking \\(m=e-2\\) yields \\(M^{\\,3^{e-1}} = (I+9L)^{3^{e-2}} \\equiv I\\pmod{3^{e}}\\), i.e., \\(M^{\\,3^{e-1}}=I\\) in \\(R\\). Therefore the order divides \\(3^{e-1}\\) and is strictly smaller than \\(3^{e}\\). \u220e\n\n#### 6.3. Equivalence with existence of a permutation \n\n**Proposition 4.** For a prime power \\(q=p^{e}\\) and \\(u,v\\in R\\) satisfying (5), the following are equivalent: \n\n(i) \\(\\operatorname{ord}(M)=p^{e}\\). \n(ii) There exists a permutation \\(g:R\\to R\\) such that \\(g(k+2)=u\\,g(k+1)+v\\,g(k)\\) for all \\(k\\) (indices modulo \\(p^{e}\\)). \n(iii) The map \\(g(k)=e_1^{\\!\\top} M^{k} v_0\\), with \\(v_0=(0,1)^{\\!\\top}\\), is a permutation of \\(R\\).\n\n*Proof.* \n**(i)\u21d2(iii):** The recurrence holds by construction. To prove bijectivity we show injectivity by induction on the exponent \\(\\beta\\) (\\(1\\le\\beta\\le e\\)) that \\(g(k)\\equiv g(\\ell)\\pmod{p^{\\beta}}\\) implies \\(k\\equiv\\ell\\pmod{p^{\\beta}}\\). \n\n*Base \\(\\beta=1\\):* Modulo \\(p\\), \\(M\\equiv I+N_0\\) with \\(N_0^2=0\\). Then \\(M^{k}\\equiv I+kN_0\\) and \n\n\\[\ng(k)\\bmod p = e_1^{\\!\\top}(I+kN_0)v_0 = e_1^{\\!\\top}v_0 + k\\,e_1^{\\!\\top}N_0 v_0 = k,\n\\] \n\nbecause \\(e_1^{\\!\\top}v_0=0\\) and \\(e_1^{\\!\\top}N_0 v_0=1\\). Hence \\(g(k)\\equiv k\\pmod p\\), giving the base case.\n\n*Inductive step:* Assume the claim holds for some \\(\\beta<e\\) and suppose \\(g(k)\\equiv g(\\ell)\\pmod{p^{\\beta+1}}\\). Reducing modulo \\(p^{\\beta}\\) gives \\(k\\equiv\\ell\\pmod{p^{\\beta}}\\), so we can write \\(\\ell = k + p^{\\beta}t\\) with \\(0\\le t<p\\). From the order analysis (Propositions\u202f2 and\u202f3, good case) we have \n\n\\[\nM^{\\,p^{\\beta}} = I + p^{\\beta} N_{\\beta},\\qquad N_{\\beta}\\bmod p\\neq0.\n\\]\n\nThen \n\n\\[\n\\begin{aligned}\ng(\\ell) &= e_1^{\\!\\top} M^{k} (M^{\\,p^{\\beta}})^{t} v_0 \\\\\n &= e_1^{\\!\\top} M^{k} \\bigl(I + t p^{\\beta} N_{\\beta} + p^{\\beta+1}E\\bigr) v_0 \\\\\n &= g(k) + t p^{\\beta}\\,\\underbrace{e_1^{\\!\\top} M^{k} N_{\\beta} v_0}_{\\lambda} + p^{\\beta+1}(\\cdots).\n\\end{aligned}\n\\] \n\nModulo \\(p\\), \\(M^{k}\\equiv I+kN_0\\) and \\(N_{\\beta}\\equiv c N_0\\) for some \\(c\\not\\equiv0\\). Thus \n\n\\[\n\\lambda \\equiv c\\,e_1^{\\!\\top}(I+kN_0)N_0 v_0 = c\\bigl(e_1^{\\!\\top}N_0 v_0 + k\\,e_1^{\\!\\top}N_0^{2}v_0\\bigr)=c,\n\\] \n\na unit modulo \\(p\\). Hence \\(\\lambda\\) is not divisible by \\(p\\). The difference \\(g(\\ell)-g(k)\\) is congruent to \\(t p^{\\beta}\\lambda\\) modulo \\(p^{\\beta+1}\\). For this to be \\(0\\) modulo \\(p^{\\beta+1}\\) we must have \\(t\\equiv0\\pmod p\\); since \\(0\\le t<p\\), \\(t=0\\). Thus \\(\\ell=k\\), proving injectivity modulo \\(p^{\\beta+1}\\). By induction, \\(g\\) is injective on \\(R\\), hence bijective.\n\n**(iii)\u21d2(ii)** is immediate.\n\n**(ii)\u21d2(i):** Let \\(g\\) be a bijection satisfying the recurrence. Choose \\(s_0=(g(0),g(1))^{\\!\\top}\\). By induction, \\(g(k)=e_1^{\\!\\top} M^{k} s_0\\). Because \\(g\\) is injective, the vectors \\(M^{k}s_0\\) for \\(k=0,\\dots,p^{e}-1\\) are distinct; thus the orbit of \\(s_0\\) has size \\(p^{e}\\). Hence \\(\\operatorname{ord}(M)\\ge p^{e}\\). Lemma\u202f1 gives \\(M^{\\,p^{e}}=I\\), so \\(\\operatorname{ord}(M)\\mid p^{e}\\). Therefore \\(\\operatorname{ord}(M)=p^{e}\\). \u220e\n\n### 7. Counting admissible pairs \\((u,v)\\) for each prime power \nFrom Propositions\u202f2\u20134 we deduce the number \\(H(p^{e})\\) of pairs \\((u,v)\\) in \\(\\mathbb{Z}/p^{e}\\mathbb{Z}\\) with \\(u\\equiv2,\\ v\\equiv-1\\pmod p\\) that admit a permutation.\n\n* **\\(p>3\\):** Every lift works. The number of such pairs is \\(p^{2(e-1)}\\) (interpreted as \\(1\\) for \\(e=1\\)). Thus \n\n \\[\n H(p^{e}) = p^{2(e-1)}.\n \\]\n\n* **\\(p=3\\):** \n \u2013 \\(e=1\\): only \\((u,v)=(2,2)\\); \\(H(3)=1\\). \n \u2013 \\(e\\ge2\\): admissible exactly when \\(U+V\\not\\equiv2\\pmod3\\). Among the \\(3^{2(e-1)}\\) lifts, the condition depends only on residues modulo \\(3\\). There are \\(9\\) residue pairs; exactly \\(3\\) satisfy \\(U+V\\equiv2\\). For each good residue class there are \\(3^{2(e-2)}\\) lifts. Hence \n\n \\[\n H(3^{e}) = 6\\cdot 3^{2(e-2)} = 2\\cdot 3^{2e-3}.\n \\]\n\n### 8. Final count of triples \\((a,b,c)\\) \nRecall that the total number is \n\n\\[\nN = \\varphi(n)\\;\\times\\; \\prod_{p\\mid n} H(p^{e_p}),\\qquad \\varphi(n)=\\prod_{p\\mid n} p^{e_p-1}(p-1).\n\\]\n\n* For \\(p>3\\): contribution \\(= p^{e_p-1}(p-1)\\cdot p^{2(e_p-1)} = p^{3e_p-3}(p-1)\\).\n\n* For \\(p=3\\): \n \u2013 if \\(3\\nmid n\\): factor \\(1\\); \n \u2013 if \\(e_3=1\\): \\(\\varphi(3)=2,\\ H(3)=1\\ \\Rightarrow\\ 2\\); \n \u2013 if \\(e_3\\ge2\\): \\(\\varphi(3^{e_3})=2\\cdot3^{e_3-1},\\ H(3^{e_3})=2\\cdot3^{2e_3-3}\\ \\Rightarrow\\ 4\\cdot3^{3e_3-4}\\).\n\nTherefore \n\n\\[\n\\boxed{ N = \\left( \\prod_{\\substack{p\\mid n\\\\ p>3}} p^{3\\operatorname{ord}_p(n)-3}(p-1) \\right) \\times \\begin{cases}\n1 & \\text{if } 3\\nmid n,\\\\[2mm]\n2 & \\text{if } \\operatorname{ord}_3(n)=1,\\\\[2mm]\n4\\cdot 3^{3\\operatorname{ord}_3(n)-4} & \\text{if } \\operatorname{ord}_3(n)\\ge 2.\n\\end{cases} }\n\\]\n\n---", "average_automatic_rating": 1.0, "human_rating": 18}}