Question

A line in the plane is called sunny if it is not parallel to any of the $x$-axis, the $y$-axis, or the line $x+y=0$.

Let $n \ge 3$ be a given integer. Determine all nonnegative integers $k$ such that there exist $n$ distinct lines in the plane satisfying both of the following:

  • for all positive integers $a$ and $b$ with $a+b\le n+1$, the point $(a,b)$ lies on at least one of the lines; and
  • exactly $k$ of the $n$ lines are sunny.
Answer
Expert verdict: 7/7

Definition. For an integer \(n\ge 3\) let

\[ P_n = \{(a,b)\in\mathbb{N}^2 \mid a\ge 1,\; b\ge 1,\; a+b\le n+1\}. \] We are asked for which nonnegative integers \(k\) there exist \(n\) distinct lines in the plane such that

every point of \(P_n\) lies on at least one of the lines, and

exactly \(k\) of the lines are sunny (i.e. not parallel to the \(x\)-axis, the \(y\)-axis, or the line \(x+y=0\)).

We will prove that for every \(n\ge 3\) the only possible values of \(k\) are \(0,1,3\).

1. Constructions for \(k = 0,1,3\)

We give explicit families of \(n\) distinct lines that satisfy the two conditions.

\(k = 0\)

Take the \(n\) horizontal lines

\[ y = 1,\; y = 2,\; \dots,\; y = n. \] Each point \((a,b)\in P_n\) lies on the line \(y = b\). No line is sunny (all are parallel to the \(x\)-axis). Hence \(k = 0\) is attainable.

\(k = 1\)

Take the \(n-1\) horizontal lines

\[ y = 1,\; y = 2,\; \dots,\; y = n-1. \] These cover all points with \(b \le n-1\). The only point not covered is \((1,n)\) (since \(a+n\le n+1\) forces \(a = 1\)). Add one extra line, for instance

\[ L:\; y = x + (n-1). \] \(L\) has slope \(1\), so it is sunny. It passes through \((1,n)\). The total number of lines is \((n-1)+1 = n\), and exactly one line is sunny. Thus \(k = 1\) is attainable.

\(k = 3\)

If \(n = 3\):Use the three sunny lines

\[ \begin{aligned} L_1 &: y = x,\\ L_2 &: y = -2x + 5,\\ L_3 &: y = -\tfrac12 x + \tfrac52. \end{aligned} \] Check: \(L_1\) contains \((1,1)\) and \((2,2)\); \(L_2\) contains \((1,3)\) and \((2,1)\); \(L_3\) contains \((1,2)\) and \((3,1)\). The six points of \(P_3\) are all covered. All three lines are sunny, so \(k = 3\).

If \(n > 3\):First take the \(n-3\) horizontal lines

\[ y = 1,\; y = 2,\; \dots,\; y = n-3. \] These cover all points with \(b \le n-3\). The remaining points are those with \(b = n-2,\, n-1,\, n\); there are exactly \(3+2+1 = 6\) such points. Translate the situation by \((0,\,-(n-3))\): the map

\[ (x,\,y) \;\longmapsto\; (x,\,y-(n-3)) \] sends these six points bijectively onto the set \(P_3\) (because \(a+b \le n+1\) becomes \(a + (b'+(n-3)) \le n+1 \iff a+b' \le 4\)). Therefore, if we take the three sunny lines that cover \(P_3\) in the translated coordinates and then translate them back, we obtain three sunny lines in the original plane:

\[ \begin{aligned} S_1 &: y = x + (n-3),\\ S_2 &: y = -2x + (n+2),\\ S_3 &: y = -\tfrac12 x + \tfrac{2n-1}{2}. \end{aligned} \] Together with the \(n-3\) horizontal lines we have \(n\) distinct lines, exactly three of which are sunny. Hence \(k = 3\) is attainable for every \(n\ge 3\).

2. Upper bound on points per sunny line

Lemma 1. For any sunny line \(L\), we have \(|L \cap P_n| \le \left\lfloor\dfrac{n+1}{2}\right\rfloor\).

Proof. If \(L\) contains no integer point, then obviously \(|L\cap P_n|\le 1\le\lfloor(n+1)/2\rfloor\) (since \(n\ge 3\)). So assume \(L\) contains at least one integer point. Since \(L\) is sunny, it is not vertical, so we can write its equation as \(y = mx + d\).

If \(m\) is irrational, then \(L\) can contain at most one integer point (two integer points would give a rational slope). Hence the bound holds. Thus we may assume \(m\) is rational.

Write \(m = p/q\) in lowest terms, \(q>0\), \(\gcd(p,q)=1\). Choose an integer point \((x_0,y_0)\) on \(L\). Then all integer points on \(L\) are

\[ (x,y) = (x_0 + q t,\; y_0 + p t),\qquad t\in\mathbb Z. \] Let the set of \(t\) for which the point lies in \(P_n\) be a consecutive integer interval \(t_{\min},\dots,t_{\max}\); let \(N\) be the number of such \(t\). Then \(t_{\max}-t_{\min} = N-1\).

For any such point we have the constraints

\[ 1 \le x \le n,\qquad 1 \le y \le n,\qquad 2 \le x+y \le n+1. \] In particular,

\begin{align*} q\,(N-1) &= |x_{\max}-x_{\min}| \le n-1, \quad\text{(A)}\\ |p|\,(N-1) &= |y_{\max}-y_{\min}| \le n-1, \quad\text{(B)}\\ |p+q|\,(N-1) &= |(x+y)_{\max}-(x+y)_{\min}| \le n-1. \quad\text{(C)} \end{align*} Set \(M = \max\{q,\ |p|,\ |p+q|\}\). Then (A)-(C) give

\[ N-1 \le \frac{n-1}{M}. \] Now, because \(L\) is sunny, we have \(p \neq 0\) (otherwise horizontal) and \(p+q \neq 0\) (otherwise slope \(-1\)). We claim that \(M \ge 2\). Suppose \(M = 1\). Then \(q = 1\) (since \(q>0\)), \(|p| \le 1\), \(|p+q| \le 1\). As \(p \neq 0\), either \(p = 1\) or \(p = -1\).

If \(p = 1\), then \(|p+q| = |1+1| = 2 > 1\), contradiction.

If \(p = -1\), then \(p+q = 0\), which is forbidden.

Hence \(M \ge 2\). Consequently,

\[ N-1 \le \frac{n-1}{2}\quad\Longrightarrow\quad N \le \frac{n+1}{2}. \] Since \(N\) is an integer, \(N \le \left\lfloor\frac{n+1}{2}\right\rfloor\). \(\square\)

3. No covering by all sunny lines for \(n \ge 4\)

Lemma 2. For \(n \ge 4\) there is no set of \(n\) distinct sunny lines that covers \(P_n\).

Proof.

Even \(n\):Write \(n = 2m\). By Lemma 1 each sunny line contains at most \(m\) points. Therefore the total number of incidences (counting each point as many times as lines through it) is at most \(n \cdot m = 2m^2\). But

\[ |P_n| = \frac{n(n+1)}{2} = m(2m+1) = 2m^2 + m > 2m^2 \qquad (m\ge1), \] so it is impossible to cover all points.

Odd \(n\):Write \(n = 2m+1\) with \(m \ge 2\) (i.e. \(n \ge 5\)). Lemma 1 gives each sunny line at most \(m+1\) points. Hence

\[ \sum_{i=1}^{n} |L_i \cap P_n| \le n (m+1) = (2m+1)(m+1). \] But

\[ |P_n| = \frac{(2m+1)(2m+2)}{2} = (2m+1)(m+1). \] Thus the inequality must be an equality. In particular, each line contains exactly \(m+1\) points, and the sum of the sizes equals \(|P_n|\). Since every point is covered at least once, equality forces each point to be covered exactly once, and therefore the \(n\) lines are pairwise disjoint.

We now classify all sunny lines that can contain exactly \(m+1\) points in \(P_n\).

Lemma 3. Let \(n = 2m+1 \ge 3\). If a sunny line \(L\) satisfies \(|L \cap P_n| = m+1\), then \(L\) is one of the three lines

\[ L_A: y = x,\qquad L_B: y = -2x + (n+2),\qquad L_C: y = -\tfrac12 x + \tfrac{n+2}{2}. \] Proof. Write \(L\) in reduced form \(y = \frac{p}{q}x + d\) with \(q>0\), \(\gcd(p,q)=1\), \(p \neq 0\), \(p+q \neq 0\). Let \(N = m+1\).

From (A)-(C) we have (with \(N-1 = m\) and \(n-1 = 2m\))

\[ q\,m \le 2m,\quad |p|\,m \le 2m,\quad |p+q|\,m \le 2m, \] hence

\[ q \le 2,\quad |p| \le 2,\quad |p+q| \le 2. \] We examine the possibilities.

Case \(q = 1\). Then \(|p| \le 2\) and \(|p+1| \le 2\). Since \(p \neq 0\) and \(p+1 \neq 0\) (i.e. \(p \neq -1\)), the admissible integers are \(p = 1\) and \(p = -2\).

Case \(q = 2\). Then \(\gcd(p,2)=1\), so \(p\) is odd. \(|p| \le 2\) forces \(p = \pm 1\). \(|p+2| \le 2\) eliminates \(p = 1\) because \(|3| > 2\); thus only \(p = -1\) remains.

Now we determine the intercept \(d\) so that exactly \(m+1\) integer points of \(P_n\) lie on the line.

Subcase (1,1): \(L: y = x + d\).

Let the integer points be \((a+i,\ a+i+d)\) for \(i = 0,1,\dots,m\) (since \(x\) increases by \(q=1\)). The \(x\)-coordinates range from \(a\) to \(a+m\) and must satisfy \(1 \le a+i \le 2m+1\). Hence \(1 \le a \le m+1\). The constraints from the bounds on \(y\) and on \(x+y\) yield:

\[ \begin{cases} a+d \ge 1,\\ a+m+d \le 2m+1,\\ 2a+2m+d \le 2m+2. \end{cases} \] The third inequality gives \(d \le 2-2a\); the second gives \(d \le m+1 - a\); the first gives \(d \ge 1-a\).

For consistency we need \(1-a \le 2-2a\), i.e. \(a \le 1\). Thus \(a = 1\). Then the bounds become \(0 \le d \le \min\{m,\,0\} = 0\), so \(d = 0\). Hence \(L: y = x\).

Subcase (1,-2): \(L: y = -2x + d\).

Again the points are \((a+i,\ -2(a+i)+d)\) with \(i=0,\dots,m\) and \(1 \le a \le m+1\). The tightest constraints come from \(y \ge 1\) (at \(i=m\)), \(y \le 2m+1\) (at \(i=0\)), and \(x+y \le 2m+2\) (at \(i=0\)):

\[ \begin{aligned} -2(a+m)+d \ge 1 \;&\Longrightarrow\; d \ge 1 + 2a + 2m,\\ -2a + d \le 2m+1 \;&\Longrightarrow\; d \le 2m+1 + 2a,\\ -a + d \le 2m+2 \;&\Longrightarrow\; d \le 2m+2 + a. \end{aligned} \] The first two give

\[ 1+2a+2m \le d \le 2m+1+2a. \] Hence \(d\) must equal \(2m+1+2a\) (the only integer satisfying both). Substituting into the third inequality yields

\[ 2m+1+2a \le 2m+2 + a \;\Longrightarrow\; a \le 1. \] Since \(a \ge 1\), we have \(a = 1\). Then \(d = 2m+1+2 = 2m+3 = n+2\). So \(L: y = -2x + (n+2)\).

Subcase (2,-1): \(L: y = -\tfrac12 x + d\).

The \(x\)-coordinates differ by \(q=2\). Let the smallest be \(a\). Then the points are \((a+2i,\ -\tfrac12(a+2i)+d)\) for \(i=0,\dots,m\). To stay within the bounds \(1 \le x \le 2m+1\) we need

\[ a \ge 1 \quad\text{and}\quad a+2m \le 2m+1 \;\Longrightarrow\; a \le 1, \] so \(a = 1\). Thus the \(x\)-coordinates are \(1,3,5,\dots,2m+1\).

For the \(y\)-coordinates to be integers, \(d\) must have the form \(d = d' + \tfrac12\) with \(d' \in \mathbb Z\). Then

\[ y_i = -\tfrac12(2i+1) + d = -i - \tfrac12 + d' + \tfrac12 = d' - i. \] Now apply the constraints:

\(y_i \ge 1\) for all \(i\): the smallest \(y\) occurs at \(i=m\) (since slope negative), so \(d' - m \ge 1 \;\Rightarrow\; d' \ge m+1\).

\(y_i \le 2m+1\) for all \(i\): the largest \(y\) occurs at \(i=0\), giving \(d' \le 2m+1\).

\(x_i + y_i = (2i+1) + (d' - i) = d' + i + 1 \le 2m+2\): the most restrictive is at \(i=m\), giving \(d' + m + 1 \le 2m+2 \;\Rightarrow\; d' \le m+1\).

Thus \(d' \ge m+1\) and \(d' \le m+1\), so \(d' = m+1\). Then \(d = m+1 + \tfrac12 = \tfrac{2m+3}{2} = \tfrac{n+2}{2}\). Hence \(L: y = -\tfrac12 x + \tfrac{n+2}{2}\).

We have exhausted all possibilities; therefore any sunny line with exactly \(m+1\) points must be one of the three listed. \(\square\)

Returning to the proof of Lemma 2 for odd \(n\ge 5\): we have \(n\) distinct sunny lines, each must contain exactly \(m+1\) points, hence each must be one of \(L_A, L_B, L_C\). But there are only three distinct such lines, while \(n \ge 5\) gives a contradiction. Hence no covering exists for odd \(n\ge 5\) either. (For \(n=3\) the three lines are exactly these three, and that case is covered by the construction.) This completes the proof of Lemma 2. \(\square\)

4. Induction on \(n\)

We now prove by strong induction that for every \(n\ge 3\) the number \(k\) of sunny lines in any covering of \(P_n\) by \(n\) distinct lines can only be \(0,1,3\).

Base case \(n = 3\). Constructions in 1 show that \(k = 0,1,3\) are attainable. We must show that \(k = 2\) is impossible.

Assume three lines cover \(P_3\) with exactly two sunny. Let the sunny lines be \(L_1, L_2\) and the third line \(L_3\) be non-sunny.

Lemma 1 implies that each sunny line contains at most two points of \(P_3\). The only pairs of points in \(P_3\) that are collinear with a sunny line (i.e. with slope different from \(0\), undefined, or \(-1\)) are exactly the three pairs:

\[ \{(1,1),(2,2)\}\ (\text{slope }1),\quad \{(1,3),(2,1)\}\ (\text{slope }-2),\quad \{(1,2),(3,1)\}\ (\text{slope }-1/2). \] Hence any sunny line that contains two points must be one of the three lines

\[ \ell_1: y=x,\quad \ell_2: y=-2x+5,\quad \ell_3: y=-\tfrac12 x+\tfrac52. \] Now consider the possibilities.

If both \(L_1\) and \(L_2\) contain two points and are disjoint. Then they must be two of the three lines \(\ell_1,\ell_2,\ell_3\). Those three lines are pairwise disjoint, so they cover four points. The two remaining points lie on the third \(\ell\), which is sunny. The third line \(L_3\) is non-sunny, so it cannot cover both of those points (the unique line through them is sunny). Contradiction.

If at least one of \(L_1, L_2\) contains at most one point. Then the two sunny lines together cover at most three points. Consequently, the non-sunny line \(L_3\) must cover at least three points. The only lines that contain three points of \(P_3\) are the three "boundary" lines:

\[ y=1,\quad x=1,\quad x+y=4. \] (One verifies that any other line contains at most two points.) So \(L_3\) is one of these three.

\textbf{

\(L_3 = y=1\): covers \((1,1),(2,1),(3,1)\). The uncovered points are \((1,2),(1,3),(2,2)\). Each of these three points lies on a different one of \(\ell_1,\ell_2,\ell_3\) (namely \((2,2)\in\ell_1\), \((1,3)\in\ell_2\), \((1,2)\in\ell_3\)). Two sunny lines can cover at most two of them (each \(\ell_i\) contains exactly one). Hence impossible.}

\textbf{

\(L_3 = x=1\): covers \((1,1),(1,2),(1,3)\). Uncovered: \((2,1),(2,2),(3,1)\). Again these are one per \(\ell_i\); two sunny lines cannot cover all three. Contradiction.}

\textbf{

\(L_3 = x+y=4\): covers \((1,3),(2,2),(3,1)\). Uncovered: \((1,1),(1,2),(2,1)\), again one per \(\ell_i\). Contradiction.} Thus \(k = 2\) is impossible, so the only possible values for \(n=3\) are \(0,1,3\).

Inductive step. Assume the statement holds for all \(m\) with \(3 \le m < n\), where \(n \ge 4\). Consider any covering of \(P_n\) by \(n\) distinct lines.

Define three special lines:

\[ R:\ y=1,\qquad C:\ x=1,\qquad D:\ x+y = n+1. \] Note that \(R, C, D\) are not sunny (horizontal, vertical, slope \(-1\) respectively).

Claim. At least one of \(R, C, D\) belongs to the covering.

Proof of claim. Suppose none of them is present. Then:

The line \(y=1\) contains \(n\) distinct points \((a,1)\). To cover a point \((a,1)\), the line must intersect \(y=1\) at that point. A horizontal line different from \(y=1\) does not intersect \(y=1\). Hence every line that covers a point on \(y=1\) must be non-horizontal. Moreover, a non-horizontal line meets \(y=1\) in at most one point. Therefore we need at least \(n\) non-horizontal lines; since there are exactly \(n\) lines, all lines are non-horizontal, and each covers exactly one point on \(y=1\).

The line \(x=1\) contains \(n\) points \((1,b)\). Since \(C\) is absent, a vertical line different from \(x=1\) does not contain any point with \(x=1\). Hence every line covering a point on \(x=1\) must be non-vertical. Since all lines are already non-horizontal, they must all be non-vertical to cover those points (a vertical line would miss \(x=1\) unless it is \(x=1\) itself). Thus all lines are non-vertical.

The line \(x+y=n+1\) contains \(n\) points. Since \(D\) is absent, a line with slope \(-1\) other than \(D\) is parallel to it and does not intersect it. Therefore every line covering a point on \(D\) must have slope different from \(-1\). Hence all lines have slope \(\neq -1\).

Therefore every line is non-horizontal, non-vertical, and slope \(\neq -1\); i.e., every line is sunny. But Lemma 2 states that for \(n\ge 4\) there is no covering of \(P_n\) by \(n\) sunny lines. Contradiction. Hence the claim holds. \(\square\)

Now we examine which of \(R, C, D\) is present. (If more than one is present, we may choose any one; the argument works in each case.)

If \(R\) is present: Remove \(R\) from the set. The remaining \(n-1\) lines still cover all points of \(P_n\) with \(y\ge 2\) (because \(R\) only covered points with \(y=1\)). Apply the translation \(\phi_R: (x,y) \mapsto (x, y-1)\). This map sends the set \(\{(x,y)\in P_n \mid y\ge 2\}\) bijectively onto \(P_{n-1}\). Moreover, \(\phi_R\) sends each line to a line (translations preserve lines). The resulting family consists of \(n-1\) distinct lines (translation preserves distinctness) and covers \(P_{n-1}\) (each point of \(P_{n-1}\) corresponds to a point with \(y\ge 2\) that was covered). Since \(R\) is not sunny, the number of sunny lines among the \(n-1\) lines remains \(k\).

Thus we have a covering of \(P_{n-1}\) by \(n-1\) distinct lines with exactly \(k\) sunny lines. By the induction hypothesis (applied to \(m=n-1\)), we must have \(k \in \{0,1,3\}\).

If \(C\) is present: Remove \(C\) and use \(\phi_C: (x,y) \mapsto (x-1, y)\). It maps \(\{(x,y)\in P_n \mid x\ge 2\}\) onto \(P_{n-1}\). \(C\) is non-sunny, so \(k\) unchanged. Induction gives \(k \in \{0,1,3\}\).

If \(D\) is present: Remove \(D\). The remaining \(n-1\) lines cover all points of \(P_n\) that are not on \(D\). Observe that \(P_{n-1} \subseteq P_n\) and \(P_{n-1} \cap D = \emptyset\) (since points in \(P_{n-1}\) satisfy \(a+b\le n\), while \(D\) requires \(a+b = n+1\). Hence they cover \(P_{n-1}\). \(D\) is not sunny, so \(k\) stays the same. Induction yields \(k \in \{0,1,3\}\).

In every possible case we conclude \(k \in \{0,1,3\}\), which completes the inductive step.

By strong induction, the statement holds for all integers \(n \ge 3\).

5. Conclusion

We have shown that for every \(n \ge 3\) the only possible numbers of sunny lines in a covering of \(P_n\) by \(n\) distinct lines are \(0\), \(1\), and \(3\). Explicit constructions demonstrate that each of these values is indeed attainable.

\[ \boxed{k \in \{0,\,1,\,3\}\ \text{ for all } n\ge 3.} \]

Question

Let $\Omega$ and $\Gamma$ be circles with centres $M$ and $N$, respectively, such that the radius of $\Omega$ is less than the radius of $\Gamma$. Suppose $\Omega$ and $\Gamma$ intersect at two distinct points $A$ and $B$. Line $MN$ intersects $\Omega$ at $C$ and $\Gamma$ at $D$, so that $C$, $M$, $N$, $D$ lie on $MN$ in that order. Let $P$ be the circumcenter of triangle $ACD$. Line $AP$ meets $\Omega$ again at $E \neq A$ and meets $\Gamma$ again at $F \neq A$. Let $H$ be the orthocenter of triangle $PMN$.

Prove that the line through $H$ parallel to $AP$ is tangent to the circumcircle of triangle $BEF$.

Answer
Expert verdict: 7/7

We will prove the statement using analytic geometry. The configuration is invariant under similarity transformations, so we may fix convenient coordinates.

1. Coordinate setup

Place \(M\) and \(N\) on the \(x\)-axis. Without loss of generality, set \(MN = 1\) (scale the figure appropriately). Let

\[ M = (0,0),\qquad N = (1,0). \] Denote the radius of \(\Omega\) (with center \(M\)) by \(r\) and the radius of \(\Gamma\) (with center \(N\)) by \(R\), with \(0 < r < R\). Since the circles intersect in two distinct points, we have

\[ R - r < 1 < R + r. \]
2. Intersection points \(A\) and \(B\)

The equations of the circles are

\[ \begin{cases} x^2 + y^2 = r^2, & \text{(\(\Omega\))}\\[2mm] (x-1)^2 + y^2 = R^2, & \text{(\(\Gamma\))}. \end{cases} \] Subtracting gives \(2x-1 = R^2 - r^2\), so

\[ x = a = \frac{1 + r^2 - R^2}{2}. \] Let \(h > 0\) be such that \(a^2 + h^2 = r^2\). The two intersections are symmetric about the \(x\)-axis; we take

\[ A = (a,\, h),\qquad B = (a,\, -h). \]
3. Points \(C\) and \(D\) on line \(MN\)

The line \(MN\) is the \(x\)-axis. Intersection of \(\Omega\) with the \(x\)-axis: \(x^2 = r^2 \Rightarrow x = \pm r\). Because the order on the line is \(C\), \(M\), \(N\), \(D\), point \(C\) must lie left of \(M\) and \(D\) right of \(N\). Hence

\[ C = (-r,\, 0),\qquad D = (1+R,\, 0). \]
4. Circumcenter \(P\) of \(\triangle ACD\)

Points \(C\) and \(D\) lie on the \(x\)-axis, so the perpendicular bisector of \(CD\) is the vertical line through the midpoint of \(CD\):

\[ \text{midpoint} = \left(\frac{-r + 1+R}{2},\,0\right) = \left(\frac{1+R-r}{2},\,0\right). \] Thus

\[ x_P = \frac{1+R-r}{2}. \] To find \(y_P\), use \(PA = PC\):

\[ (x_P - a)^2 + (y_P - h)^2 = (x_P + r)^2 + y_P^2. \] Expanding and using \(a^2+h^2 = r^2\) yields

\[ -2h y_P = 2(r+a)x_P \quad\Longrightarrow\quad y_P = -\frac{(r+a)x_P}{h}. \] Hence

\[ P = \left(\frac{1+R-r}{2},\; -\frac{(r+a)x_P}{h}\right). \]
5. Simplifying notation with auxiliary parameters

Introduce

\[ p = R + r,\qquad q = R - r,\qquad S = 1 + R + r = 1 + p. \] Then

\[ r = \frac{p - q}{2},\quad R = \frac{p + q}{2},\quad a = \frac{1 - p q}{2},\quad x_P = \frac{1 + q}{2}. \] From \(h^2 = r^2 - a^2\) we obtain

\[ h^2 = \frac{(p^2-1)(1-q^2)}{4}. \] Also

\[ r + a = \frac{S(1 - q)}{2}. \]
6. Vector \(\overrightarrow{AP}\)

Set \(\vec{v} = \overrightarrow{AP} = (v_1,\, v_2)\).

\[ v_1 = x_P - a = \frac{1+q}{2} - \frac{1 - p q}{2} = \frac{q + p q}{2} = \frac{q S}{2}. \] For \(v_2\):

\[ v_2 = y_P - h = -\frac{(r+a)x_P}{h} - h = -\frac{(r+a)x_P + h^2}{h}. \] Since \(h^2 = (r-a)(r+a)\),

\[ (r+a)x_P + h^2 = (r+a)(x_P + r - a). \] Compute \(x_P + r - a\):

\[ x_P + r - a = \frac{1+q}{2} + r - \frac{1 - p q}{2} = \frac{q + 2r + p q}{2}. \] But \(2r = p - q\), so

\[ q + 2r + p q = q + (p - q) + p q = p + p q = p(1 + q). \] Thus

\[ x_P + r - a = \frac{p(1+q)}{2}. \] Now \((r+a) = \dfrac{S(1-q)}{2}\), so

\[ (r+a)(x_P + r - a) = \frac{S(1-q)}{2} \cdot \frac{p(1+q)}{2} = \frac{p S (1 - q^2)}{4}. \] Therefore

\[ v_2 = -\frac{1}{h}\cdot\frac{p S (1 - q^2)}{4} = -\frac{p S (1 - q^2)}{4h}. \]
7. Points \(E\) and \(F\) (second intersections of \(AP\) with the circles)

Parameterize line \(AP\) as \(A + \lambda \vec{v}\). Substitute into \(\Omega\): \(|A + \lambda \vec{v}|^2 = r^2\). Because \(|A|^2 = r^2\), we get

\[ 2\lambda (\vec{v}\cdot A) + \lambda^2 |\vec{v}|^2 = 0. \] Hence \(\lambda = 0\) (point \(A\)) or

\[ \lambda_E = -\frac{2\,\vec{v}\cdot A}{|\vec{v}|^2}. \] Similarly, for \(\Gamma\) substitute into \(|(A+\lambda\vec{v}) - N|^2 = R^2\) (since \(N=(1,0)\)). \(|A - N|^2 = R^2\), so

\[ \lambda_F = -\frac{2\,\vec{v}\cdot(A - N)}{|\vec{v}|^2}. \] Now compute the needed dot products.

\[ \vec{v}\cdot A = a v_1 + h v_2 = a\cdot\frac{q S}{2} + h\left(-\frac{p S (1 - q^2)}{4h}\right) = \frac{a q S}{2} - \frac{p S (1 - q^2)}{4} = \frac{S}{4}\bigl(2a q - p(1 - q^2)\bigr). \] But \(2a q = q(1 - p q) = q - p q^2\), so

\[ 2a q - p(1 - q^2) = q - p q^2 - p + p q^2 = q - p. \] Thus

\[ \vec{v}\cdot A = \frac{S}{4}(q - p) = -\frac{S(p - q)}{4} = -\frac{S\cdot 2r}{4} = -\frac{r S}{2}. \] Next,

\[ \vec{v}\cdot(A - N) = \vec{v}\cdot A - v_1 = -\frac{r S}{2} - \frac{q S}{2} = -\frac{S(r+q)}{2} = -\frac{R S}{2}, \] because \(r+q = R\).

Consequently,

\[ \lambda_E = -\frac{2\bigl(-\frac{r S}{2}\bigr)}{|\vec{v}|^2} = \frac{r S}{|\vec{v}|^2}, \qquad \lambda_F = -\frac{2\bigl(-\frac{R S}{2}\bigr)}{|\vec{v}|^2} = \frac{R S}{|\vec{v}|^2}. \] Hence

\[ E = A + \frac{r S}{|\vec{v}|^2}\,\vec{v}, \qquad F = A + \frac{R S}{|\vec{v}|^2}\,\vec{v}. \]
8. Orthocenter \(H\) of \(\triangle PMN\)

Vertices: \(M = (0,0)\), \(N = (1,0)\), \(P = (x_P, y_P)\).

Side \(MN\) is horizontal, so the altitude from \(P\) is the vertical line \(x = x_P\).

Altitude from \(M\) is the line through \(M\) perpendicular to \(PN\). Vector \(\overrightarrow{PN} = (1 - x_P,\,-y_P)\). A vector perpendicular to \(PN\) is \((y_P,\, 1 - x_P)\) (since \((1-x_P)y_P + (-y_P)(1-x_P)=0\)). Parametric equation: \(t\,(y_P,\,1 - x_P)\).

The orthocenter \(H\) is the intersection of \(x = x_P\) with this altitude. So set

\[ t y_P = x_P \quad\Longrightarrow\quad t = \frac{x_P}{y_P}\ \ (y_P \neq 0). \] Then

\[ H = \bigl(x_P,\ t(1 - x_P)\bigr) = \left(x_P,\ \frac{x_P(1 - x_P)}{y_P}\right). \] Now substitute \(y_P = -\dfrac{(r+a)x_P}{h}\):

\[ \frac{x_P(1 - x_P)}{y_P} = \frac{x_P(1 - x_P)}{-\frac{(r+a)x_P}{h}} = -\frac{h(1 - x_P)}{r+a}. \] Compute \(1 - x_P = 1 - \dfrac{1+q}{2} = \dfrac{1 - q}{2}\). And \(r + a = \dfrac{S(1 - q)}{2}\). Therefore

\[ -\frac{h(1 - x_P)}{r+a} = -\frac{h \cdot \frac{1 - q}{2}}{\frac{S(1 - q)}{2}} = -\frac{h}{S}. \] Thus

\[ H = \left(\frac{1+q}{2},\; -\frac{h}{S}\right). \]
9. Circumcenter \(O'\) of \(\triangle BEF\)

We will determine \(O' = (x, y)\) that is equidistant from \(B\), \(E\), \(F\).

Because \(E\) and \(F\) lie on line \(AP\), the segment \(EF\) is collinear with \(\vec{v}\). The perpendicular bisector of \(EF\) consists of points \(X\) satisfying \(\vec{v}\cdot (X - M_{EF}) = 0\), where \(M_{EF}\) is the midpoint of \(EF\).

The midpoint:

\[ M_{EF} = \frac{E+F}{2} = A + \frac{\lambda_E + \lambda_F}{2}\,\vec{v}. \] Since \(\lambda_E + \lambda_F = \dfrac{(r+R)S}{|\vec{v}|^2} = \dfrac{p S}{|\vec{v}|^2}\),

\[ M_{EF} = A + \frac{p S}{2|\vec{v}|^2}\,\vec{v}. \] Hence the condition \(\vec{v}\cdot X = \vec{v}\cdot M_{EF}\) gives

\[ \vec{v}\cdot O' = \vec{v}\cdot A + \frac{p S}{2}. \] But \(\vec{v}\cdot A = -\dfrac{r S}{2}\), so

\[ \vec{v}\cdot O' = -\frac{r S}{2} + \frac{p S}{2} = \frac{(p - r) S}{2} = \frac{R S}{2}. \quad\text{(1)} \] Next impose \(|O' - B|^2 = |O' - E|^2\). Write \(U = O' - A\). Then

\[ O' - B = U - w,\quad \text{with } w = B - A = (0,\,-2h), \] and

\[ O' - E = U - \lambda_E \vec{v}. \] Then \[ |U - w|^2 = |U - \lambda_E \vec{v}|^2. \] Expand:

\[ |U|^2 - 2 U\cdot w + |w|^2 = |U|^2 - 2\lambda_E \vec{v}\cdot U + \lambda_E^2 |\vec{v}|^2. \] Cancel \(|U|^2\):

\[ -2 U\cdot w + |w|^2 = -2\lambda_E \vec{v}\cdot U + \lambda_E^2 |\vec{v}|^2. \quad\text{(2)} \] Now \(U\cdot w = (x - a)\cdot 0 + (y - h)(-2h) = -2h(y - h)\). Thus

\[ -2 U\cdot w + |w|^2 = -2[-2h(y - h)] + 4h^2 = 4h(y - h) + 4h^2 = 4h y. \] So (2) becomes

\[ 4h y = -2\lambda_E \vec{v}\cdot U + \lambda_E^2 |\vec{v}|^2. \quad\text{(3)} \] We have

\[ \vec{v}\cdot U = \vec{v}\cdot(O' - A) = \vec{v}\cdot O' - \vec{v}\cdot A = \frac{R S}{2} - \left(-\frac{r S}{2}\right) = \frac{(R + r)S}{2} = \frac{p S}{2}. \] Recall \(\lambda_E = \dfrac{r S}{|\vec{v}|^2}\). Substitute into (3):

\[ 4h y = -2\left(\frac{r S}{|\vec{v}|^2}\right)\cdot \frac{p S}{2} + \left(\frac{r S}{|\vec{v}|^2}\right)^2 |\vec{v}|^2 = -\frac{r p S^2}{|\vec{v}|^2} + \frac{r^2 S^2}{|\vec{v}|^2} = \frac{r S^2}{|\vec{v}|^2}(r - p) = -\frac{r p S^2}{|\vec{v}|^2} + \frac{r^2 S^2}{|\vec{v}|^2} = -\frac{r R S^2}{|\vec{v}|^2} \qquad (\text{since } p - r = R). \] Thus

\[ 4h y = -\frac{r R S^2}{|\vec{v}|^2}, \qquad\text{so}\qquad y = -\frac{r R S^2}{4h |\vec{v}|^2}. \quad\text{(4)} \]
10. Computation of \(|\vec{v}|^2\)

We have

\[ v_1 = \frac{q S}{2},\qquad v_2 = -\frac{p S (1 - q^2)}{4h}. \] Hence

\[ v_1^2 = \frac{q^2 S^2}{4}, \] \[ v_2^2 = \frac{p^2 S^2 (1 - q^2)^2}{16 h^2}. \] Using \(h^2 = \dfrac{(p^2-1)(1 - q^2)}{4}\),

\[ v_2^2 = \frac{p^2 S^2 (1 - q^2)}{4(p^2 - 1)}. \] Therefore

\[ |\vec{v}|^2 = \frac{S^2}{4}\left(q^2 + \frac{p^2 (1 - q^2)}{p^2 - 1}\right) = \frac{S^2}{4}\cdot \frac{q^2(p^2-1) + p^2(1 - q^2)}{p^2 - 1}. \] The numerator simplifies:

\[ q^2(p^2-1) + p^2(1 - q^2) = p^2 - q^2. \] Thus

\[ |\vec{v}|^2 = \frac{S^2}{4}\cdot \frac{p^2 - q^2}{p^2 - 1}. \] Now \(p^2 - q^2 = (R+r)^2 - (R-r)^2 = 4Rr.\) And \(p^2 - 1 = (p-1)(p+1) = (R+r-1)(R+r+1) = (R+r-1)S.\)

Hence

\[ |\vec{v}|^2 = \frac{S^2}{4}\cdot \frac{4Rr}{(R+r-1)S} = \frac{S R r}{R+r-1}. \quad\text{(5)} \]
11. Simplify \(y\) from (4)

Insert (5) into (4):

\[ y = -\frac{r R S^2}{4h}\cdot \frac{R+r-1}{S R r} = -\frac{S (R+r-1)}{4h}. \quad\text{(6)} \]
12. Determine \(x\) from equation (1)

Equation (1): \(\vec{v}\cdot O' = v_1 x + v_2 y = \dfrac{R S}{2}\).

We know \(v_1 = \dfrac{q S}{2}\), and from (6) we have \(y\). Compute \(v_2 y\).

\[ v_2 = -\frac{p S (1 - q^2)}{4h},\qquad y = -\frac{S (R+r-1)}{4h}. \] Thus

\[ v_2 y = \frac{p S^2 (1 - q^2) (R+r-1)}{16 h^2}. \] Recall \(4h^2 = (R+r-1) S (1 - q^2)\). Then \(16 h^2 = 4 (R+r-1) S (1 - q^2)\).

\[ v_2 y = \frac{p S^2 (1 - q^2) (R+r-1)}{4 (R+r-1) S (1 - q^2)} = \frac{p S}{4}. \] Now (1) becomes

\[ \frac{q S}{2}\, x + \frac{p S}{4} = \frac{R S}{2}. \] Divide by \(S \neq 0\):

\[ \frac{q}{2}\, x + \frac{p}{4} = \frac{R}{2}. \] Multiply by \(4\):

\[ 2q x + p = 2R. \] Now \(q = R - r\), \(p = R + r\), so

\[ 2(R - r) x + (R + r) = 2R \quad\Longrightarrow\quad 2(R - r) x = 2R - (R + r) = R - r. \] Since \(R \neq r\) (strict inequality), we obtain

\[ x = \frac{R - r}{2(R - r)} = \frac12. \] Therefore the circumcenter of \(\triangle BEF\) is

\[ O' = \left(\frac12,\; -\frac{S (R+r-1)}{4h}\right). \quad\text{(7)} \]
13. Distance from \(O'\) to the line through \(H\) parallel to \(\vec{v}\)

Let \(\ell\) be the line through \(H\) with direction \(\vec{v}\).

The distance from a point to a line with direction \(\vec{v}\) through \(H\) is

\[ d = \frac{|(O' - H) \times \vec{v}|}{|\vec{v}|}, \] where the cross product (in the plane) is taken as the scalar \(\Delta x\cdot v_2 - \Delta y\cdot v_1\).

Coordinates:

\[ H = \left(\frac{1+q}{2},\; -\frac{h}{S}\right). \] Compute differences:

\[ \Delta x = \frac12 - x_H = \frac12 - \frac{1+q}{2} = -\frac{q}{2}. \] \[ \Delta y = y_{O'} - y_H = -\frac{S (R+r-1)}{4h} - \left(-\frac{h}{S}\right) = -\frac{S (R+r-1)}{4h} + \frac{h}{S}. \] Write as a single fraction:

\[ \Delta y = \frac{ -S^2 (R+r-1) + 4h^2 }{4h S}. \] But \(4h^2 = (R+r-1) S (1 - q^2)\). Hence

\[ \Delta y = \frac{ (R+r-1) S (1 - q^2) - S^2 (R+r-1) }{4h S} = \frac{ (R+r-1) S \bigl( (1 - q^2) - S \bigr)}{4h S} = \frac{ (R+r-1) \bigl( (1 - q^2) - S \bigr)}{4h}. \] Now \(S = 1 + p\), so

\[ (1 - q^2) - S = 1 - q^2 - 1 - p = -p - q^2. \] Thus

\[ \Delta y = -\frac{ (R+r-1) (p + q^2)}{4h}. \quad\text{(8)} \] Now compute the cross product:

\[ \Delta \times \vec{v} = \Delta x \cdot v_2 - \Delta y \cdot v_1. \] \[ \Delta x \cdot v_2 = \left(-\frac{q}{2}\right)\left(-\frac{p S (1 - q^2)}{4h}\right) = \frac{q p S (1 - q^2)}{8h}. \] \[ \Delta y \cdot v_1 = \left(-\frac{ (R+r-1) (p + q^2)}{4h}\right) \left(\frac{q S}{2}\right) = -\frac{q S (R+r-1) (p + q^2)}{8h}. \] Therefore

\[ \Delta \times \vec{v} = \frac{q p S (1 - q^2)}{8h} - \left( -\frac{q S (R+r-1) (p + q^2)}{8h} \right) = \frac{q S}{8h}\Bigl( p (1 - q^2) + (R+r-1)(p + q^2) \Bigr). \] But \(R+r-1 = p - 1\). So the bracket becomes

\[ p (1 - q^2) + (p - 1)(p + q^2). \] Expand:

\[ p(1 - q^2) = p - p q^2, \] \[ (p - 1)(p + q^2) = p(p-1) + (p-1)q^2 = p^2 - p + p q^2 - q^2. \] Sum:

\[ (p - p q^2) + (p^2 - p + p q^2 - q^2) = p^2 - q^2. \] Thus

\[ \Delta \times \vec{v} = \frac{q S}{8h} (p^2 - q^2) = \frac{q S}{8h} \cdot 4Rr = \frac{q S R r}{2 h}. \] Since \(q = R - r\),

\[ \Delta \times \vec{v} = \frac{ (R - r) S R r}{2 h}. \quad\text{(9)} \]
14. Squared distance from \(O'\) to \(\ell\)

\[ d^2 = \frac{ \left( \dfrac{ (R - r) S R r}{2 h} \right)^2 }{ |\vec{v}|^2 } = \frac{ (R - r)^2 S^2 R^2 r^2}{4 h^2} \cdot \frac{1}{|\vec{v}|^2}. \] Substitute \(|\vec{v}|^2 = \dfrac{S R r}{R+r-1}\):

\[ d^2 = \frac{ (R - r)^2 S^2 R^2 r^2}{4 h^2} \cdot \frac{R+r-1}{S R r} = \frac{ (R - r)^2 S R r (R+r-1)}{4 h^2}. \quad\text{(10)} \] Now use \(4h^2 = (R+r-1) S (1 - q^2)\):

\[ d^2 = \frac{ (R - r)^2 S R r (R+r-1)}{ (R+r-1) S (1 - q^2) } = \frac{ (R - r)^2 R r}{1 - (R - r)^2}. \quad\text{(11)} \]
15. Radius of the circumcircle of \(\triangle BEF\)

Compute \(R_c = |O' - B|\), with \(B = (a,\,-h)\) and \(O'\) as in (7).

\[ \Delta x' = \frac12 - a = \frac12 - \frac{1 - p q}{2} = \frac{p q}{2}. \] \[ \Delta y' = y_{O'} + h = -\frac{S (R+r-1)}{4h} + h = \frac{4h^2 - S (R+r-1)}{4h}. \] Again, \(4h^2 = (R+r-1) S (1 - q^2)\),

\[ \Delta y' = \frac{ (R+r-1) S (1 - q^2) - S (R+r-1) }{4h} = \frac{ S (R+r-1) (1 - q^2 - 1)}{4h} = -\frac{ S (R+r-1) q^2}{4h}. \] Thus

\[ R_c^2 = \left(\frac{p q}{2}\right)^2 + \left(-\frac{ S (R+r-1) q^2}{4h}\right)^2 = \frac{p^2 q^2}{4} + \frac{ S^2 (R+r-1)^2 q^4}{16 h^2}. \] Substitute \(16 h^2 = 4 (R+r-1) S (1 - q^2)\):

\[ R_c^2 = \frac{p^2 q^2}{4} + \frac{ S^2 (R+r-1)^2 q^4}{4 (R+r-1) S (1 - q^2)} = \frac{p^2 q^2}{4} + \frac{ S (R+r-1) q^4}{4 (1 - q^2)}. \] Write as

\[ R_c^2 = \frac{q^2}{4}\left( p^2 + \frac{ S (R+r-1) q^2}{1 - q^2} \right). \] Now \(S (R+r-1) = (p+1)(p-1) = p^2 - 1.\) Therefore

\[ R_c^2 = \frac{q^2}{4} \cdot \frac{ p^2(1 - q^2) + (p^2 - 1) q^2}{1 - q^2} = \frac{q^2}{4} \cdot \frac{ p^2 - p^2 q^2 + p^2 q^2 - q^2}{1 - q^2} = \frac{q^2}{4} \cdot \frac{ p^2 - q^2}{1 - q^2}. \] Since \(p^2 - q^2 = 4R r\) and \(q^2 = (R - r)^2\),

\[ R_c^2 = \frac{ (R - r)^2}{4} \cdot \frac{4R r}{1 - (R - r)^2} = \frac{ (R - r)^2 R r}{1 - (R - r)^2}. \quad\text{(12)} \]
16. Conclusion

Comparing (11) and (12) we obtain

\[ d^2 = R_c^2, \] so \(d = R_c\) (all quantities are nonnegative).

Hence the distance from the circumcenter \(O'\) of \(\triangle BEF\) to the line \(\ell\) (through \(H\) parallel to \(AP\)) equals the radius of its circumcircle. Therefore \(\ell\) is tangent to the circumcircle of \(\triangle BEF\).

Question

A function $f \colon \mathbb{N} \to \mathbb{N}$ is said to be bonza if \[ f(a)\quad\text{divides}\quad b^a-f(b)^{f(a)} \] for all positive integers $a$ and $b$.

Determine the smallest real constant $c$ such that $f(n) \leq cn$ for all bonza functions $f$ and all positive integers $n$.

Answer
Expert verdict: 7/7
1. Preliminary lemmas

Lemma 1. \(f(1)=1\).

Proof. Taking \(a=b=1\) gives \(f(1)\mid 1^{1}-f(1)^{f(1)}=1-f(1)^{f(1)}\).

Since \(f(1)\mid f(1)^{f(1)}\), we have \(f(1)\mid 1\). Hence \(f(1)=1\).

Lemma 2. For every positive integer \(a\), \(f(a)\mid a^{a}\).

Proof. Put \(b=a\) in the definition: \(f(a)\mid a^{a}-f(a)^{f(a)}\).

Because \(f(a)\mid f(a)^{f(a)}\), it follows that \(f(a)\mid a^{a}\).

Corollary. If a prime \(p\) divides \(f(a)\), then \(p\) divides \(a\).

Proof. From \(f(a)\mid a^{a}\), any prime divisor of \(f(a)\) must divide \(a^{a}\), hence \(a\).

2. Determination of \(f(2)\), \(f(3)\) and \(f(5)\)

From Lemma 2 we have:

\[ f(2)\mid 2^{2}=4\quad\Longrightarrow\quad f(2)\in\{1,2,4\}, \] \[ f(3)\mid 3^{3}=27\quad\Longrightarrow\quad f(3)\in\{1,3,9,27\}. \] \[ f(5)\mid 5^{5}=3125\quad\Longrightarrow\quad f(5)=5^{\delta}\ \text{with}\ 0\le\delta\le 5. \] Now use the mixed conditions \((a,b)=(2,3)\) and \((3,2)\):

\[ \begin{aligned} (2,3)&:\ f(2)\mid 3^{2}-f(3)^{f(2)}=9-f(3)^{f(2)},\\ (3,2)&:\ f(3)\mid 2^{3}-f(2)^{f(3)}=8-f(2)^{f(3)}. \end{aligned} \] Let \(x=f(2),\ y=f(3)\). We test all \(x\in\{1,2,4\},\ y\in\{1,3,9,27\}\) (note all \(y\) are odd).

\textbf{

\(x=1\): \((2,3)\) automatic. \((3,2)\) gives \(y\mid 8-1^{y}=7\). Only \(y=1\) divides 7. So \((1,1)\) works.}

\textbf{

\(x=2\):} \((2,3)\): \(2\mid 9-y^{2}\). Since \(y\) is odd, \(y^{2}\) is odd, \(9-\text{odd}\) is even - holds for all odd \(y\).

\((3,2)\): \(y\mid 8-2^{y}\).

\(y=1\): \(1\mid6\) - true.

\(y=3\): \(3\mid 8-8=0\) - true.

\(y=9\): \(9\mid 8-512=-504\) - true (\(-504/9=-56\)).

\(y=27\): compute \(2^{27}\bmod27\). \(2^{9}\equiv512\equiv26\pmod{27}\), then \(2^{27}=(2^{9})^{3}\equiv26^{3}\equiv(-1)^{3}=-1\equiv26\pmod{27}\). So \(8-26=-18\not\equiv0\pmod{27}\) - false.

Thus for \(x=2\) we have \((2,1),\ (2,3),\ (2,9)\).

\textbf{

\(x=4\):} \((2,3)\): \(4\mid 9-y^{4}\). For odd \(y\), \(y^{4}\equiv1\pmod4\), so \(9-1=8\) divisible by 4 - holds for all odd \(y\). \((3,2)\): \(y\mid 8-4^{y}\).

\(y=1\): \(1\mid8-4=4\) - true.

\(y=3\): \(3\mid 8-64=-56\) - false.

\(y=9\): \(4^{3}\equiv64\equiv1\pmod9\), so \(4^{9}\equiv1\pmod9\), then \(8-1=7\not\equiv0\pmod9\) - false.

\(y=27\): \(4^{3}\equiv64\equiv10\pmod{27}\), so \(4^{9}\equiv10^{3}=1000\equiv1\pmod{27}\), thus \(4^{27}\equiv1\pmod{27}\), \(8-1=7\not\equiv0\pmod{27}\) - false.

Hence only \((4,1)\) works.

Therefore after \((2,3)\) and \((3,2)\) the possible pairs are

\[ (1,1),\ (2,1),\ (2,3),\ (2,9),\ (4,1). \quad\text{(1)} \] Now incorporate \(f(5)=5^{\delta}\). For each candidate pair we must satisfy

\[ \begin{aligned} (2,5)&:\ x\mid 25-5^{\delta x},\\ (3,5)&:\ y\mid 125-5^{\delta y},\\ (5,2)&:\ 5^{\delta}\mid 32 - x^{5^{\delta}},\\ (5,3)&:\ 5^{\delta}\mid 243 - y^{5^{\delta}}. \end{aligned} \] We test \(\delta=0,1,2,3,4,5\) for each pair.

1. Pair \((x,y)=(1,1)\).

\((2,5)\) automatic.

\((3,5)\) automatic.

\((5,2)\): \(5^{\delta}\mid 32-1^{5^{\delta}}=31\). So \(5^{\delta}\mid31\) forces \(\delta=0\).

\((5,3)\): \(5^{\delta}\mid 243-1^{5^{\delta}}=242\). Again only \(\delta=0\) works.

\(\Rightarrow (f(2),f(3),f(5))=(1,1,1)\).

2. Pair \((x,y)=(2,1)\).

\((2,5)\): \(2\mid 25-5^{2\delta}\) - difference even, automatic.

\((3,5)\): \(1\) divides everything.

\((5,3)\): \(5^{\delta}\mid 243-1=242\). Since \(5\nmid242\), only \(\delta=0\).

\((5,2)\) with \(\delta=0\): \(1\mid32-2=30\) - true.

\(\Rightarrow (2,1,1)\).

3. Pair \((x,y)=(4,1)\).

\((2,5)\): \(4\mid 25-5^{2\delta}\). Mod 4: \(25\equiv1\), \(5^{2\delta}\equiv1\), difference divisible by 4 - automatic.

\((3,5)\): automatic.

\((5,3)\): \(5^{\delta}\mid 242\) - forces \(\delta=0\).

\((5,2)\) with \(\delta=0\): \(1\mid32-4=28\) - true.

\(\Rightarrow (4,1,1)\).

4. Pair \((x,y)=(2,3)\).

\((2,5)\): automatic (even difference).

\((3,5)\): \(3\mid125-5^{3\delta}\).

\((5,2)\): \(5^{\delta}\mid 32-2^{5^{\delta}}\).

\((5,3)\): \(5^{\delta}\mid 243-3^{5^{\delta}}\).

Test \(\delta\):

\(\delta=0\): \(f(5)=1\). Then \(3\mid125-1=124\) - false.

\(\delta=1\): \(f(5)=5\).

\(3\mid125-5^{3}=0\) - true.

\(5\mid32-2^{5}=0\) - true.

\(5\mid243-3^{5}=0\) - true.

So \(\delta=1\) works.

\(\delta=2\): \(f(5)=25\). \(3\mid125-5^{6}\). Mod 3: \(125\equiv2\), \(5^{6}\equiv(5^{3})^{2}\equiv2^{2}=4\equiv1\), so difference \(2-1=1\) - false.

\(\delta=3\): \(f(5)=125\).

\(3\mid125-5^{9}\): \(5^{9}\equiv5^{3}\equiv125\equiv2\pmod3\), difference \(0\) - true.

Check \((5,2)\): \(125\mid32-2^{125}\). Compute \(2^{125}\bmod125\): \(\varphi(125)=100\), so \(2^{125}\equiv2^{25}\pmod{125}\). \(2^{5}=32\), \(2^{10}\equiv24\), \(2^{20}\equiv24^{2}=576\equiv576-5\cdot125=76\), then \(2^{25}=2^{20}\cdot2^{5}\equiv76\cdot32=2432\equiv2432-19\cdot125=57\). So \(32-57=-25\) not divisible by 125 - false.

\(\delta=4\): \(f(5)=625\). \(3\mid125-5^{12}\). \(5^{12}\equiv(5^{6})^{2}\equiv1^{2}=1\pmod3\), \(125\equiv2\), difference \(1\) - false.

\(\delta=5\): \(f(5)=3125\).

\(3\mid125-5^{15}\): \(5^{15}\equiv5^{3}\equiv125\equiv2\pmod3\), difference \(0\) - true.

\((5,2)\): \(3125\mid32-2^{3125}\). Mod 125: \(3125\equiv25\pmod{100}\), so \(2^{3125}\equiv2^{25}\equiv57\pmod{125}\) as before, \(32-57=-25\) not divisible by 125 - false.

Thus only \(\delta=1\) works, giving \((2,3,5)\).

5. Pair \((x,y)=(2,9)\).

Test \(\delta\):

\(\delta=0\): \(3\mid125-1=124\) - false.

\(\delta=1\): \(5\mid125-5^{9}\). \(5^{9}\bmod9\): \(5^{6}\equiv1\pmod9\) (since \(\varphi(9)=6\)), so \(5^{9}\equiv5^{3}=125\equiv8\pmod9\). \(125\equiv8\), difference \(0\) - true.

\((5,2)\): \(5\mid32-2^{5}=0\) - true. \((5,3)\): \(5\mid243-9^{5}\). \(9\equiv4\pmod5\), \(4^{5}=1024\equiv4\pmod5\). \(243\equiv3\pmod5\), so \(3-4=-1\not\equiv0\pmod5\) - false.

\(\delta=2\): \(25\mid125-5^{18}\). \(5^{18}\equiv(5^{6})^{3}\equiv1^{3}=1\pmod9\), \(125\equiv8\), difference \(7\) - false.

\(\delta=3\): \(125\mid125-5^{27}\). \(5^{27}\equiv5^{3}\equiv8\pmod9\), difference \(0\) - true.

\((5,2)\): \(125\mid32-2^{125}\). As before, \(2^{125}\equiv57\pmod{125}\), \(32-57=-25\) - false.

\(\delta=4\): \(625\mid125-5^{36}\). \(36\equiv0\pmod6\), so \(5^{36}\equiv1\pmod9\), difference \(7\) - false.

\(\delta=5\): \(3125\mid125-5^{45}\). \(45\equiv3\pmod6\), \(5^{45}\equiv8\pmod9\), difference \(0\) - true.

\((5,2)\): \(3125\mid32-2^{3125}\). Mod 125 fails as before.

Hence no \(\delta\) satisfies all conditions.

Conclusion of classification. The only admissible triples \((f(2),f(3),f(5))\) are

\[ (1,1,1),\quad (2,1,1),\quad (4,1,1),\quad (2,3,5). \] We will analyze two families:

\textbf{Family A:

those with \(f(3)=1\), i.e. the first three triples.}

\textbf{Family B:

the triple \((2,3,5)\).}

3. Analysis of Family A (\(f(3)=1\))

Lemma 3. If \(f(3)=1\), then \(f(q)=1\) for every odd prime \(q\).

Proof. From \((q,q)\) we have \(f(q)\mid q^{q}\), so \(f(q)=q^{k}\) for some \(0\le k\le q\).

Consider \((q,3)\):

\[ f(q)\mid 3^{q}-f(3)^{f(q)}=3^{q}-1^{f(q)}=3^{q}-1. \] If \(k\ge1\), then \(q\mid f(q)\mid 3^{q}-1\). By Fermat's little theorem, \(3^{q}\equiv3\pmod q\), so \(q\mid 3-1=2\). Hence \(q=2\), contradicting that \(q\) is odd. Therefore \(k=0\) and \(f(q)=1\).

Lemma 4. In Family A, for every positive integer \(n\), \(f(n)\) is a power of 2.

Proof. Suppose an odd prime \(r\) divides \(f(n)\). By Lemma 2, \(r\mid n\). Now use \((n,r)\):

\[ f(n)\mid r^{n}-f(r)^{f(n)}. \] Since \(r\) is odd, Lemma 3 gives \(f(r)=1\). Hence

\[ f(n)\mid r^{n}-1. \] In particular, \(r\mid r^{n}-1\), i.e. \(r\mid -1\), contradiction. Thus no odd prime divides \(f(n)\); i.e. \(f(n)=2^{e(n)}\) for some \(e(n)\ge0\).

Lemma 5. For any \(n\), \(2^{e(n)}\mid 3^{n}-1\).

Proof. Take \((n,3)\):

\[ f(n)\mid 3^{n}-f(3)^{f(n)}=3^{n}-1^{f(n)}=3^{n}-1. \] Since \(f(n)=2^{e(n)}\), we have \(2^{e(n)}\mid 3^{n}-1\).

Lemma 6. For \(n\in\mathbb N\),

\[ v_{2}(3^{n}-1)=\begin{cases} 1 & \text{if } n \text{ is odd},\\ v_{2}(n)+2 & \text{if } n \text{ is even}. \end{cases} \] Proof.

Odd \(n\): Write

\[ 3^{n}-1=(3-1)(3^{n-1}+3^{n-2}+\cdots+1)=2\cdot(\text{odd sum}), \] because there are \(n\) terms, each odd, and \(n\) odd $\Rightarrow$ the sum is odd. Hence \(v_{2}=1\).

Even \(n\): Write \(n=2^{\alpha}m\) with \(m\) odd, \(\alpha\ge1\). We prove by induction on \(\alpha\) that \(v_{2}(3^{2^{\alpha}m}-1)=\alpha+2\).

Base \(\alpha=1\): \(n=2m\). Then

\[ 3^{2m}-1=(3^{m}-1)(3^{m}+1). \] We know \(v_{2}(3^{m}-1)=1\) (since \(m\) odd). For \(3^{m}+1\), note \(3^{m}\equiv 3\pmod 8\) when \(m\) is odd, so \(3^{m}+1\equiv 4\pmod 8\), thus \(v_{2}(3^{m}+1)=2\). Hence

\[ v_{2}(3^{2m}-1)=1+2=3=1+2=\alpha+2. \] Inductive step: Assume true for a given \(\alpha\ge1\). Write \(n'=2^{\alpha+1}m = 2\cdot(2^{\alpha}m)\). Let \(k=2^{\alpha}m\). Then \[ 3^{n'}-1=(3^{k}-1)(3^{k}+1). \] By hypothesis, \(v_{2}(3^{k}-1)=\alpha+2\).

Since \(k\) is even (because \(\alpha\ge1\)), \(3^{k}\equiv 1\pmod 4\), so \(3^{k}+1\equiv 2\pmod 4\), giving \(v_{2}(3^{k}+1)=1\).

Thus

\[ v_{2}(3^{n'}-1)=(\alpha+2)+1=\alpha+3=(\alpha+1)+2. \] This completes the induction.

From Lemmas 5 and 6 we obtain

\[ e(n)\le \begin{cases} 1 & \text{if } n \text{ is odd},\\ v_{2}(n)+2 & \text{if } n \text{ is even}. \end{cases} \] Consequently

\[ f(n)=2^{e(n)}\le \begin{cases} 2 & \text{if } n \text{ odd},\\ 2^{v_{2}(n)+2} & \text{if } n \text{ even}. \end{cases} \] For even \(n\), \(2^{v_{2}(n)+2}=4\cdot2^{v_{2}(n)}\le 4n\) because \(2^{v_{2}(n)}\mid n\) implies \(2^{v_{2}(n)}\le n\). For odd \(n\), \(2\le 4n\) (since \(n\ge1\)).

Hence in Family A we have

\[ \boxed{f(n)\le4n\quad\text{for all }n\in\mathbb N}. \]
4. Analysis of Family B (\(f(2)=2,\ f(3)=3,\ f(5)=5\))

Proposition 7. For every prime \(p\), \(f(p)=p\).

Proof. We proceed by strong induction on \(p\). The base cases \(p=2,3,5\) are given.

Assume \(p>5\) and that for every prime \(q<p\) we already know \(f(q)=q\).

From \((p,p)\) we have \(f(p)\mid p^{p}\), so \(f(p)=p^{k}\) for some integer \(k\) with \(0\le k\le p\). We show that \(k\) must be 1.

Step 1 - Eliminate \(k=0\) and \(k=2\).

Take any prime \(q<p\). Consider \((q,p)\):

\[ f(q)=q\mid p^{q}-f(p)^{q}=p^{q}-p^{kq}. \] Factor out \(p^{q}\):

\[ q\mid p^{q}(1-p^{(k-1)q}). \] Since \(q\neq p\), \(q\nmid p^{q}\). Hence

\[ q\mid 1-p^{(k-1)q}. \] By Fermat's little theorem, \(p^{q}\equiv p\pmod q\), and more generally \(p^{(k-1)q}\equiv p^{k-1}\pmod q\) (raising to the \(q\)th power is the identity modulo \(q\)). Thus

\[ 1-p^{k-1}\equiv 0\pmod q\quad\Longrightarrow\quad p^{k-1}\equiv 1\pmod q. \quad\text{(2)} \]

If \(k=0\), then the original condition \((q,p)\) gives \(q\mid p^{q}-1\). Using FLT, \(p^{q}\equiv p\pmod q\), so \(p\equiv1\pmod q\).

If \(k=2\), (2) gives \(p^{1}\equiv1\pmod q\), i.e. \(p\equiv1\pmod q\).

Thus for both \(k=0\) and \(k=2\) we have

\[ p\equiv 1\pmod q \qquad\text{for every prime } q<p. \quad\text{(3)} \] Now by Bertrand's postulate (for any integer \(m>1\) there exists a prime between \(m\) and \(2m\)), for \(p>3\) there exists a prime \(q\) with \(\frac{p}{2}<q<p\). From (3), \(q\mid p-1\). But \(q>p/2\) and \(q\le p-1\) (since \(q<p\)). The only positive multiple of \(q\) that is at most \(p-1\) is \(q\) itself (because \(2q>p\)). Hence \(p-1=q\), so \(p=q+1\), which is even - contradicting that \(p>2\) is odd. Therefore \(k\) cannot be \(0\) or \(2\).

Step 2 - Eliminate \(k\ge3\).

Consider the pair \((p,\,p-1)\):

\[ f(p)=p^{k}\mid (p-1)^{p} - f(p-1)^{p^{k}}. \] Let \(r = f(p-1)\).

\textbf{Modulo

\(p\):} \[ (p-1)^{p}\equiv (-1)^{p} = -1\pmod p, \] and by Fermat's little theorem, \(r^{p^{k}}\equiv r\pmod p\) (since \(r^{p}\equiv r\pmod p\), and then by induction \(r^{p^{k}}\equiv r\pmod p\).

Since \(p^{k}\mid D := (p-1)^{p} - r^{p^{k}}\), in particular \(p\mid D\). Reducing modulo \(p\) gives

\[ -1 \equiv r \pmod p,\qquad\text{i.e.}\quad r\equiv -1\pmod p. \quad\text{(4)} \] Write \(r = -1 + p t\) for some integer \(t\).

\textbf{Expansion of

\((p-1)^{p}\):} By the binomial theorem,

\[ (p-1)^{p} = \sum_{i=0}^{p}\binom{p}{i}p^{i}(-1)^{p-i}. \] The term with \(i=0\) is \((-1)^{p} = -1\). The term with \(i=1\) is \(\binom{p}{1}p^{1}(-1)^{p-1} = p\cdot p\cdot1 = p^{2}\).

For \(i\ge2\), \(\binom{p}{i}\) is divisible by \(p\), and together with \(p^{i}\) yields a factor \(p^{i+1}\ge p^{3}\). Thus we can write

\[ (p-1)^{p} = -1 + p^{2} A, \] where \(A\) is an integer and, because the \(i=1\) term contributes exactly \(p^{2}\) and the higher terms are multiples of \(p^{3}\), we have \(A\equiv 1\pmod p\) (in particular \(p\nmid A\)).

\textbf{Expansion of

\(r^{p^{k}}\):} Write \(r = -1 + p t\). Then

\[ r^{p^{k}} = \sum_{j=0}^{p^{k}}\binom{p^{k}}{j}(-1)^{p^{k}-j}(p t)^{j}. \] Since \(p^{k}\) is odd, \((-1)^{p^{k}} = -1\).

\(j=0\): term = \(-1\).

\(j=1\): \(\binom{p^{k}}{1}(-1)^{p^{k}-1}p t = p^{k}\cdot 1\cdot p t = p^{k+1} t\).

For \(j\ge2\): we show that each term is divisible by \(p^{k+2}\).

Indeed, for \(j\ge2\),

\[ v_{p}\Bigl(\binom{p^{k}}{j}\Bigr) = k - v_{p}(j), \] hence

\[ v_{p}\biggl(\binom{p^{k}}{j}p^{j}\biggr) = (k - v_{p}(j)) + j = k + j - v_{p}(j) \ge k+2, \] because \(j\ge2\) and if \(p\nmid j\) then \(j\ge2\) and \(v_{p}(j)=0\); if \(p\mid j\) then \(j\ge p\) and \(v_{p}(j)\ge1\), so \(j - v_{p}(j) \ge j- (j-1) =1\)? Wait, need to be precise: For any \(j\) with \(2\le j\le p^{k}-1\), we have

\[ v_{p}\Bigl(\binom{p^{k}}{j}\Bigr) = k - v_{p}(j) \] (a standard property for prime powers). Then \[ v_{p}\Bigl(\binom{p^{k}}{j} p^{j}\Bigr) = k - v_{p}(j) + j = k + j - v_{p}(j). \] Since \(j\ge2\) and \(v_{p}(j)\le \log_{p} j < j\), but we need at least \(k+2\). The minimal value occurs when \(j=2\) and \(p\nmid 2\) (since \(p\ge3\)), then \(v_{p}(j)=0\), giving \(k+2\). For \(j=p\) we have \(v_{p}(j)=1\), then \(k + p - 1 \ge k+2\) because \(p\ge3\). So indeed each term for \(j\ge2\) is divisible by \(p^{k+2}\).

Therefore

\[ r^{p^{k}} = -1 + p^{k+1} t + p^{k+2} S \] for some integer \(S\).

\textbf{Form the difference:

} \[ D = (p-1)^{p} - r^{p^{k}} = (-1 + p^{2} A) - (-1 + p^{k+1} t + p^{k+2} S) = p^{2} A - p^{k+1} t - p^{k+2} S. \] Factor \(p^{2}\):

\[ D = p^{2}\bigl(A - p^{k-1} t - p^{k} S\bigr). \quad\text{(5)} \] Since \(k\ge3\), we have \(k-1\ge2\), so \(p^{k-1} t\) and \(p^{k} S\) are both multiples of \(p^{2}\). Moreover,

\[ A - p^{k-1} t - p^{k} S \equiv A \pmod p, \] and \(p\nmid A\). Hence the expression in parentheses is not divisible by \(p\), and we obtain

\[ v_{p}(D) = 2. \] However, we require \(v_{p}(D) \ge k \ge 3\) (because \(p^{k}\mid D\)). This contradiction shows that \(k\ge3\) is impossible.

Since \(k\) cannot be \(0\), \(2\), or \(\ge3\), the only remaining possibility is \(k=1\). Thus \(f(p)=p\).

Proposition 8. In Family B, \(f(n)=n\) for all positive integers \(n\).

Proof. Fix any \(n\) and any prime \(p\). Using the bonza condition with \(a=p\), \(b=n\):

\[ f(p)=p \mid n^{p} - f(n)^{p}. \] By Fermat's little theorem,

\[ n^{p}\equiv n\pmod p,\qquad f(n)^{p}\equiv f(n)\pmod p. \] Therefore

\[ p\mid n - f(n). \] This holds for every prime \(p\). The only integer divisible by all primes is 0, so \(n-f(n)=0\), i.e. \(f(n)=n\).

Hence in Family B we have \(f(n)=n\le 4n\) for all \(n\).

5. Upper bound summary

We have shown:

In Family A, \(f(n)\le 4n\) for all \(n\).

In Family B, \(f(n)=n\le 4n\).

Therefore for every bonza function \(f\) and every \(n\in\mathbb N\),

\[ \boxed{f(n)\le 4n}. \]
6. Sharpness: a bonza function attaining \(4n\)

Define a function \(h:\mathbb N\to\mathbb N\) by

\[ h(1)=1, \] and for \(n\ge 2\):

\[ h(n)=\begin{cases} 1 & \text{if } n \text{ is odd},\\[2pt] 4 & \text{if } n=2,\\[2pt] 2^{v_{2}(n)+2} & \text{if } n \text{ is even and } n>2. \end{cases} \] We verify that \(h\) is bonza, i.e.,

\[ h(a)\mid b^{a} - h(b)^{h(a)}\quad\text{for all } a,b\in\mathbb N. \]
Verification

We consider cases based on \(a\).

\textbf{Case 1:

\(a\) is odd.} Then \(h(a)=1\) (by definition: for odd \(n>1\), \(h(n)=1\); and \(a=1\) gives \(1\)). Since \(1\) divides any integer, the condition holds trivially.

\textbf{Case 2:

\(a=2\).} Here \(h(2)=4\). We must show

\[ 4\mid b^{2} - h(b)^{4}\quad\text{for all } b. \]

If \(b\) is odd: \(b^{2}\) is odd, \(h(b)=1\), so \(h(b)^{4}=1\). Then \(b^{2}-1\) is divisible by 4 because for an odd \(b\), \(b^{2}\equiv1\pmod8\), hence certainly by 4.

If \(b=2\): \(b^{2}=4\), \(h(b)=4\), \(h(b)^{4}=4^{4}=256\). Then \(4-256=-252\), and \(-252\) is divisible by 4.

If \(b\) is even and \(b>2\): write \(b=2^{\beta}c\) with \(\beta\ge1\), \(c\) odd. Then \(h(b)=2^{\beta+2}\) (since \(b>2\) even). Then \(h(b)^{4}=2^{4(\beta+2)}=2^{4\beta+8}\), which is divisible by 4. Moreover, \(b^{2}\) is divisible by 4 (since \(b\) is even). Thus \(b^{2}-h(b)^{4}\) is a difference of two multiples of 4, hence itself a multiple of 4.

Therefore the condition holds for \(a=2\).

\textbf{Case 3:

\(a\) is even and \(a>2\).} Let \(\alpha = v_{2}(a)\) (so \(\alpha\ge1\); note that if \(a\) is even and \(>2\), then either \(\alpha\ge2\) or \(\alpha=1\) with \(a=2m\), \(m\) odd \(\ge3\)). Then \(h(a)=2^{\alpha+2}\). We need to prove

\[ 2^{\alpha+2} \mid b^{a} - h(b)^{2^{\alpha+2}}. \] We split into subcases according to \(b\).

\textbf{Subcase 3a:

\(b\) is odd.} Then \(h(b)=1\). So we need \(2^{\alpha+2}\mid b^{a}-1\).

Since \(a\) is even, write \(a = 2^{\alpha} m\) with \(m\) odd.

Claim: For any odd integer \(b\) and any integer \(s\ge1\),

\[ b^{2^{s}} \equiv 1 \pmod{2^{s+2}}. \] Proof of claim. For \(s=1\), any odd \(b\) satisfies \(b^{2}\equiv1\pmod8\), i.e. modulo \(2^{3}\). Assume the claim holds for some \(s\ge1\). Then

\[ b^{2^{s}} = 1 + 2^{s+2} K \] for some integer \(K\). Squaring gives \[ b^{2^{s+1}} = (1 + 2^{s+2} K)^{2} = 1 + 2^{s+3} K + 2^{2s+4} K^{2} \equiv 1 \pmod{2^{s+3}}, \] because the extra term is divisible by \(2^{s+3}\). This proves the claim.

Applying the claim with \(s=\alpha\) yields

\[ b^{2^{\alpha}} \equiv 1 \pmod{2^{\alpha+2}}. \] Then

\[ b^{a} = \bigl(b^{2^{\alpha}}\bigr)^{m} \equiv 1^{m} = 1 \pmod{2^{\alpha+2}}, \] and therefore \(b^{a}-1\) is divisible by \(2^{\alpha+2}\).

\textbf{Subcase 3b:

\(b=1\).} Then \(b^{a}=1\), \(h(b)=h(1)=1\), so \(h(b)^{2^{\alpha+2}}=1\), and \(1-1=0\) is divisible by any integer.

\textbf{Subcase 3c:

\(b=2\).} Here \(h(b)=h(2)=4\). So we need

\[ 2^{\alpha+2} \mid 2^{a} - 4^{2^{\alpha+2}} = 2^{a} - (2^{2})^{2^{\alpha+2}} = 2^{a} - 2^{2\cdot 2^{\alpha+2}} = 2^{a} - 2^{2^{\alpha+3}}. \] Let \(D = 2^{a} - 2^{2^{\alpha+3}}\). The \(2\)-adic valuation of a difference of two powers of two is

\[ v_{2}(D) = \begin{cases} a & \text{if } a < 2^{\alpha+3},\\ 2^{\alpha+3} & \text{if } a > 2^{\alpha+3},\\ \text{higher} & \text{if } a = 2^{\alpha+3} \text{ (then } D=0\text{)}. \end{cases} \] We claim \(v_{2}(D)\ge\alpha+2\).

Lemma 9. If \(a\) is even and \(a>2\), then \(a \ge \alpha+2\) where \(\alpha=v_{2}(a)\).

Proof. Write \(a = 2^{\alpha}\cdot m\) with \(m\) odd.

If \(\alpha = 1\), then \(a = 2m\) with \(m\) odd. Since \(a>2\), we have \(m\ge3\), so \(a\ge6\). Meanwhile \(\alpha+2 = 3\). So \(a \ge 3\).

If \(\alpha \ge 2\), then \(a \ge 2^{\alpha}\). It remains to show \(2^{\alpha} \ge \alpha+2\) for \(\alpha\ge2\). This is true for \(\alpha=2\) (\(4\ge4\)), and if true for \(\alpha\), then \(2^{\alpha+1} = 2\cdot2^{\alpha} \ge 2(\alpha+2) = 2\alpha+4 \ge (\alpha+1)+2\) for \(\alpha\ge -1\), which holds. Hence \(a \ge \alpha+2\).

Now we have two possibilities:

If \(a \le 2^{\alpha+3}\), then \(v_{2}(D) = a\) (if \(a < 2^{\alpha+3}\)) or \(D=0\) (if \(a = 2^{\alpha+3}\)). In either case, since \(a \ge \alpha+2\), we get \(v_{2}(D) \ge \alpha+2\).

If \(a > 2^{\alpha+3}\), then \(v_{2}(D) = 2^{\alpha+3}\). Since \(\alpha\ge1\), \(2^{\alpha+3} \ge 2^{4}=16\) for \(\alpha=1\), and \(\alpha+2=3\); clearly \(2^{\alpha+3} \ge \alpha+2\) (e.g. for \(\alpha=1\), \(16\ge3\); for larger \(\alpha\) it's even larger). Thus \(v_{2}(D) \ge \alpha+2\).

Therefore \(2^{\alpha+2}\mid D\).

\textbf{Subcase 3d:

\(b\) is even and \(b>2\).} Write \(b = 2^{\beta}c\) with \(\beta = v_{2}(b)\ge1\) and \(c\) odd. Since \(b>2\), we have \(\beta\ge1\); note that if \(b=2\) we already handled.

Then \(h(b) = 2^{\beta+2}\) (by definition, because \(b\) is even and \(b>2\)).

We need to show \(2^{\alpha+2}\) divides

\[ b^{a} - \bigl(2^{\beta+2}\bigr)^{2^{\alpha+2}} = b^{a} - 2^{(\beta+2)2^{\alpha+2}}. \] Observe that the second term is a power of two, and its exponent is \((\beta+2)2^{\alpha+2} \ge 2^{\alpha+2}\) (since \(\beta\ge1\) gives \(\beta+2\ge3\)). Hence it is certainly divisible by \(2^{\alpha+2}\).

For the first term,

\[ b^{a} = (2^{\beta}c)^{a} = 2^{\beta a} c^{a}. \] Since \(c^{a}\) is odd, the \(2\)-adic valuation of \(b^{a}\) is \(\beta a\). By Lemma 9, \(a \ge \alpha+2\). Therefore \[ \beta a \ge a \ge \alpha+2. \] Thus \(2^{\alpha+2} \mid b^{a}\).

Consequently both \(b^{a}\) and the second term are multiples of \(2^{\alpha+2}\), so their difference is also a multiple of \(2^{\alpha+2}\).

All subcases are exhausted, and in each the required divisibility holds.

Thus \(h\) is bonza.

Now evaluate \(h(n)\) for powers of two:

\(h(2)=4 = 2\cdot2\).

For any \(t\ge2\), \(n=2^{t}\) is even and \(>2\), so

\[ h(2^{t}) = 2^{v_{2}(2^{t})+2} = 2^{t+2} = 4\cdot 2^{t} = 4n. \] In particular, \(h(4)=16 = 4\cdot4\). Hence

\[ \frac{h(n)}{n} = 4 \quad\text{for all } n=2^{t}\ (t\ge2). \] If \(c<4\), then for \(n=4\) (or any \(2^{t}\) with \(t\ge2\)) we have

\[ h(4) = 16 > c\cdot 4, \] so \(c\) cannot satisfy \(f(n)\le cn\) for all bonza functions. Therefore no constant smaller than 4 works.

7. Conclusion

We have proved that \(4\) is an upper bound for \(f(n)/n\) and that this bound is attainable. Consequently, the smallest real constant \(c\) with the property that \(f(n)\le cn\) for every bonza function \(f\) and every \(n\in\mathbb N\) is

\[ \boxed{4}. \]

Question

An infinite sequence \(a_1, a_2, \dots\) consists of positive integers has each of which has at least three proper divisors. Suppose that for each $n\geq 1$, $a_{n+1}$ is the sum of the three largest proper divisors of $a_n$. Determine all possible values of $a_1$.

Answer
Expert verdict: 7/7

Let \(a_1,a_2,\dots\) be an infinite sequence of positive integers such that each \(a_n\) has at least three proper divisors, and for each \(n\ge 1\)

\[ a_{n+1}=\text{sum of the three largest proper divisors of }a_n. \] Define the function \(f\) by \(f(N) =\) sum of the three largest proper divisors of \(N\).

1. A useful formula for \(f(N)\)

Let the positive divisors of \(N\) be

\[ 1=d_1<d_2<\dots<d_k=N, \] where \(k\ge4\) because \(N\) has at least three proper divisors. The three largest proper divisors are \(d_{k-3}, d_{k-2}, d_{k-1}\). Using the divisor pairing \(d_i\cdot d_{k+1-i}=N\), we get

\[ d_{k-1}=\frac{N}{d_2},\quad d_{k-2}=\frac{N}{d_3},\quad d_{k-3}=\frac{N}{d_4}. \] Thus

\[ f(N)=\frac{N}{d_2}+\frac{N}{d_3}+\frac{N}{d_4}=N\left(\frac{1}{d_2}+\frac{1}{d_3}+\frac{1}{d_4}\right). \quad\text{(1)} \]
2. Fixed points

A fixed point satisfies \(f(N)=N\). From (1) this is equivalent to

\[ \frac{1}{d_2}+\frac{1}{d_3}+\frac{1}{d_4}=1. \quad\text{(2)} \] Let \(a=d_2,\;b=d_3,\;c=d_4\) (so \(2\le a<b<c\)). Solve \(1/a+1/b+1/c=1\).

\textbf{If

\(a=2\), then \(1/b+1/c=1/2\). Multiplying gives \(2(b+c)=bc\) or \((b-2)(c-2)=4\). With \(b<c\), the only solution is \(b-2=1,\;c-2=4\), i.e., \((a,b,c)=(2,3,6)\).}

\textbf{If

\(a=3\), then \(1/b+1/c=2/3\). But the maximum for \(b\ge4,c\ge5\) is \(1/4+1/5=9/20<2/3\), so no solution.}

\textbf{If

\(a\ge4\), the sum is at most \(1/4+1/5+1/6=37/60<1\).} Hence the unique triple is \((2,3,6)\). Therefore a fixed point must have

\[ d_2=2,\quad d_3=3,\quad d_4=6. \] Interpretation:

\(2\mid N\) (so \(N\) even),

\(3\mid N\),

There is no divisor between \(3\) and \(6\); i.e., \(4\nmid N\) and \(5\nmid N\).

Because \(2\) is the smallest divisor \(>1\), we must have \(\nu_2(N)=1\) (otherwise \(4\mid N\) would be a divisor \(<6\)).

Thus the set \(\mathcal{F}\) of all fixed points is

\[ \boxed{\mathcal{F}=\bigl\{N\in\mathbb{N}\;\big|\; \nu_2(N)=1,\;3\mid N,\;5\nmid N\bigr\}.} \]
3. Special case: \(12\mid N\)

If \(12\mid N\), then \(2,3,4\mid N\) and these are the three smallest proper divisors (since \(4\) is the smallest possible after \(2,3\)). Then

\[ f(N)=\frac{N}{2}+\frac{N}{3}+\frac{N}{4}=\frac{13}{12}N. \quad\text{(3)} \]
4. Lemma on odd numbers

Lemma 1. Let \(X\) be an odd positive integer with at least three proper divisors. Then \(f(X)<X\) and \(f(X)\) is odd.

Proof. All divisors of an odd number are odd. The three smallest divisors greater than \(1\) are at least \(3,5,7\). Therefore

\[ \frac{1}{d_2}+\frac{1}{d_3}+\frac{1}{d_4}\le\frac{1}{3}+\frac{1}{5}+\frac{1}{7}=\frac{71}{105}<1, \] so \(f(X)<X\). Moreover, each quotient \(X/d_i\) is odd (odd divided by odd). The sum of three odd numbers is odd, hence \(f(X)\) is odd.

An immediate corollary:

In an infinite orbit, no term can be odd, because starting from an odd term the sequence would be strictly decreasing and infinite - impossible. Hence every term of an infinite sequence is even.

5. Lemma for even numbers not divisible by \(12\)

Lemma 2. Let \(Y\) be an even integer with at least three proper divisors and \(12\nmid Y\). If the orbit of \(Y\) is infinite, then \(Y\in\mathcal{F}\).

Proof. Since \(12\nmid Y\) and \(Y\) is even, we have either \(4\nmid Y\) or \(3\nmid Y\) (or both). Consider two cases.

Case 1: \(3\mid Y\)

Because \(12\nmid Y\), we must have \(4\nmid Y\); thus \(\nu_2(Y)=1\). Write \(Y=2M\) with \(M\) odd. Since \(3\mid Y\) and \(\gcd(2,3)=1\), we get \(3\mid M\).

The three smallest proper divisors are \(d_2=2\) and \(d_3=3\). The fourth divisor \(d_4\) depends on \(5\).

\textbf{Subcase 1a:

\(5\mid M\). Then \(5\mid Y\) and \(5<6\), so \(d_4=5\). Then} \[ f(Y)=\frac{Y}{2}+\frac{Y}{3}+\frac{Y}{5}=\frac{31}{30}Y>Y. \] Moreover, \(Y\) is divisible by \(30\) (it contains factors \(2,3,5\)), so \(Y=30Z\) with \(Z\) odd. Then \(f(Y)=31Z\), which is odd. By Lemma 1, the orbit from an odd number is strictly decreasing and finite - contradiction to infinite orbit. Hence this subcase cannot occur.

\textbf{Subcase 1b:

\(5\nmid M\). Then no divisor equals \(4\) or \(5\); the next divisor after \(2,3\) is \(6=2\cdot3\). Hence \(d_4=6\), and} \[ f(Y)=\frac{Y}{2}+\frac{Y}{3}+\frac{Y}{6}=Y. \] Thus \(Y\) is a fixed point, i.e., \(Y\in\mathcal{F}\).

Therefore, if the orbit is infinite, we must be in Subcase 1b, so \(Y\in\mathcal{F}\).

Case 2: \(3\nmid Y\)

Then \(Y\) is even but not divisible by \(3\). For any such \(Y\) we have

\[ \frac{1}{d_2}+\frac{1}{d_3}+\frac{1}{d_4}\le\frac{1}{2}+\frac{1}{4}+\frac{1}{5}=\frac{19}{20}<1, \] so \(f(Y)<Y\). If the orbit never contained a term divisible by \(3\), then we would have an infinite strictly decreasing sequence - impossible. Hence there exists a smallest index \(m\ge2\) with \(3\mid a_m\). Then \(a_{m-1}\) is not divisible by \(3\), and \(a_m=f(a_{m-1})<a_{m-1}\).

Now examine \(a_{m-1}\).

\textbf{Subcase 2a:

\(a_{m-1}\) is odd. By Lemma 1, \(a_m=f(a_{m-1})\) is odd and less than \(a_{m-1}\). Since \(a_m\) is odd and divisible by \(3\), Lemma 1 again implies that from \(a_m\) onward the sequence is strictly decreasing and odd - finite, contradiction.}

\textbf{Subcase 2b:

\(a_{m-1}\) is even. Write \(Y=a_{m-1}=2M\), with \(M\) odd. Since \(3\nmid Y\), we have \(3\nmid M\). We will show that \(a_m\) is odd, reducing to Subcase 2a and giving a contradiction.} Let \(r=Y\bmod 3\) (\(r=1\) or \(2\)). For any divisor \(d\) of \(Y\) (which is coprime to \(3\)), we have \(d\equiv1\) or \(2\pmod3\) and \(d^{-1}\equiv d\pmod3\) (because \(1\cdot1\equiv1,\;2\cdot2\equiv1\pmod3\)). Hence

\[ \frac{Y}{d}\equiv r\cdot d\pmod3. \] Thus

\[ f(Y)\equiv r\bigl(d_2+d_3+d_4\bigr)\pmod3. \] Since \(r\neq0\), the condition \(3\mid f(Y)\) is equivalent to

\[ 2+d_3+d_4\equiv0\pmod3. \quad\text{(4)} \] Now, \(d_2=2\). Determine \(d_3,d_4\).

First, \(4\) cannot divide \(Y\). If \(4\mid Y\), then \(d_3=4\), and (4) gives \(2+4+d_4\equiv0\Rightarrow d_4\equiv0\pmod3\), impossible because \(3\nmid Y\). So \(\nu_2(Y)=1\): \(Y=2M\) with \(M\) odd, and \(4\nmid Y\).

Thus the smallest divisor greater than \(2\) is an odd number; call it \(p\). Since \(3\nmid Y\), \(p\neq3\), so \(p\ge5\).

The next divisor \(d_4\) is the smallest divisor larger than \(p\). Since \(4\nmid Y\), the next even divisor would be \(2p\). So either

\(d_4=q\) (an odd divisor, \(p<q<2p\)) if such an odd divisor exists, or

\(d_4=2p\) (if there is no odd divisor between \(p\) and \(2p\)).

Check the two possibilities against (4) with \(d_3=p\):

\[ 2+p+d_4\equiv0\pmod3. \quad\text{(5)} \]

If \(d_4=2p\), then \(2+p+2p=2+3p\equiv2\pmod3\), not \(0\). Hence \(d_4\) cannot be \(2p\). Therefore there exists an odd divisor \(q\) with \(p<q<2p\) and \(d_4=q\).

Then (5) becomes \(2+p+q\equiv0\pmod3\). Since \(p,q\not\equiv0\pmod3\), the only way is

\[ p\equiv q\equiv2\pmod3. \] Now compute \(f(Y)\):

\[ f(Y)=\frac{Y}{2}+\frac{Y}{p}+\frac{Y}{q}=M+\frac{2M}{p}+\frac{2M}{q}. \] Because \(p,q\) divide \(M\) (they are odd divisors of \(Y=2M\)), the fractions are integers. Now

\(M\) is odd,

\(\frac{2M}{p}=2\cdot\frac{M}{p}\) is even,

\(\frac{2M}{q}\) is even.

Thus \(f(Y)=\text{odd}+\text{even}+\text{even}=\text{odd}\).

Hence \(a_m=f(Y)\) is odd. But \(3\mid a_m\) (by definition of \(m\)). So \(a_m\) is an odd multiple of \(3\). By Lemma 1, the orbit from \(a_m\) is strictly decreasing and odd - finite, contradiction.

Both subcases lead to contradiction. Therefore Case 2 cannot occur. The only possibility is Case 1, and specifically Subcase 1b, which forces \(Y\in\mathcal{F}\).

6. Necessity - form of \(a_1\) in an infinite orbit

Assume the sequence is infinite. Let \(N=a_1\). Define

\[ t=\max\{k\ge0\mid 12^k\mid N\}. \] Write \(N=12^tR\) with \(12\nmid R\).

We claim that for \(i=1,\dots,t\), the term \(a_i\) is divisible by \(12\). Proof by induction: \(a_1=12^tR\) is divisible by \(12\) (if \(t\ge1\)). Suppose \(a_i\) is divisible by \(12\). Since \(12\mid a_i\), we have by (3) that \(a_{i+1}=\frac{13}{12}a_i\). If we write \(a_i=12^s\cdot S\) with \(12\nmid S\) and \(s\ge1\), then \(a_{i+1}=12^{s-1}(13S)\). Since \(12\nmid S\) and \(13\) is coprime to \(12\), we have \(12\nmid13S\). Thus \(a_{i+1}\) is divisible by \(12^{s-1}\). Starting with \(s=t\) at \(i=1\), after \(i\) steps the exponent of \(12\) is \(t-i+1\). Hence as long as \(i\le t\), the exponent is at least \(1\), i.e., \(12\mid a_i\).

Thus we can apply (3) exactly \(t\) times:

\[ a_{t+1}=\left(\frac{13}{12}\right)^t a_1 = \frac{13^t}{12^t}\cdot 12^tR = 13^tR. \] Now \(12\nmid R\) and \(\gcd(13,12)=1\), so \(12\nmid 13^tR\); i.e., \(12\nmid a_{t+1}\).

The orbit of \(a_{t+1}\) is also infinite (tail of an infinite sequence). By the corollary of Lemma 1, \(a_{t+1}\) cannot be odd; hence \(a_{t+1}\) is even. Also each term has at least three proper divisors. Therefore \(a_{t+1}\) satisfies the hypotheses of Lemma 2 (even, not divisible by \(12\), infinite orbit). Lemma 2 then yields

\[ a_{t+1}\in\mathcal{F}. \] Recall \(a_{t+1}=13^tR\). Since \(13^t\) is coprime to \(30\), the properties defining \(\mathcal{F}\) must already hold for \(R\):

\(\nu_2(a_{t+1})=\nu_2(R)=1\),

\(3\mid a_{t+1}\) and \(3\nmid13^t\) $\Rightarrow$ \(3\mid R\),

\(5\nmid a_{t+1}\) and \(5\nmid13^t\) $\Rightarrow$ \(5\nmid R\).

Thus \(R\in\mathcal{F}\). We have shown

\[ \boxed{a_1=12^{\,t}\cdot K\quad\text{with }t\ge0,\ K\in\mathcal{F}}. \]
7. Sufficiency - every such number works

We prove by induction on \(t\) that if \(a_1=12^tK\) with \(K\in\mathcal{F}\), then the sequence is infinite.

\textbf{Base case

\(t=0\): \(a_1=K\in\mathcal{F}\). By definition of a fixed point, \(f(K)=K\). Hence the sequence is constant: \(a_n=K\) for all \(n\). Since \(K\) has at least three proper divisors (as shown when characterizing \(\mathcal{F}\)), the sequence is infinite.}

\textbf{Inductive step:

Assume the statement holds for all starting values with parameter \(t-1\) (where \(t\ge1\)). Let \(a_1=12^tK\) with \(K\in\mathcal{F}\). Because \(12\mid a_1\), we can use (3):} \[ a_2=f(a_1)=\frac{13}{12}a_1=\frac{13}{12}\cdot12^tK=12^{t-1}(13K). \] Now, because \(K\in\mathcal{F}\), we have \(\nu_2(K)=1,\ 3\mid K,\ 5\nmid K\). Multiplying by \(13\) (coprime to \(30\)) preserves these properties, so \(13K\in\mathcal{F}\). Thus

\[ a_2=12^{t-1}L\quad\text{with }L=13K\in\mathcal{F}. \] By the induction hypothesis, the sequence starting from \(a_2\) is infinite. Consequently, the whole sequence from \(a_1\) is infinite.

This completes the induction, establishing sufficiency.

8. Final characterization

Combining necessity and sufficiency, the possible values of \(a_1\) are exactly those positive integers that can be written as

\[ a_1 = 12^{\,t} \cdot K \qquad (t\ge0,\ K\in\mathcal{F}), \] where

\[ \mathcal{F}=\bigl\{K\in\mathbb{N}\;\big|\; \nu_2(K)=1,\ 3\mid K,\ 5\nmid K\bigr\}. \] Equivalently, in terms of prime exponents:

\[ \nu_2(a_1)\text{ is odd},\quad \nu_3(a_1)>\tfrac12\nu_2(a_1),\quad 5\nmid a_1. \] More explicitly, writing

\[ t = \left\lfloor\frac{\nu_2(a_1)}{2}\right\rfloor,\qquad \ell = \nu_3(a_1)-(t+1)\ge0,\qquad \gcd(R,30)=1, \] we have

\[ a_1 = 2^{2t+1}\cdot3^{t+1+\ell}\cdot R. \] \[ \boxed{a_1 = 12^{\,t} \cdot K \text{ with } t \ge 0 \text{ and } K \text{ satisfying } 2\parallel K,\ 3\mid K,\ 5\nmid K.} \] \[ \boxed{a_1 = 2^{2t+1}\cdot 3^{t+1+\ell}\cdot R,\quad t,\ell\ge0,\ \gcd(R,30)=1.} \] This completely solves the problem.

Question

Alice and Bazza are playing the inekoalaty game, a two‑player game whose rules depend on a positive real number $\lambda$ which is known to both players. On the $n$th turn of the game (starting with $n=1$) the following happens:

  • If $n$ is odd, Alice chooses a nonnegative real number $x_n$ such that \[ x_1 + x_2 + \cdots + x_n \le \lambda n. \]
  • If $n$ is even, Bazza chooses a nonnegative real number $x_n$ such that \[ x_1^2 + x_2^2 + \cdots + x_n^2 \le n. \]

If a player cannot choose a suitable $x_n$, the game ends and the other player wins. If the game goes on forever, neither player wins. All chosen numbers are known to both players.

Determine all values of $\lambda$ for which Alice has a winning strategy and all those for which Bazza has a winning strategy.

Answer
Expert verdict: 7/7

We begin by setting notation and a couple of useful lemmas. For each \(n\ge 1\), let

\[ S_n = \sum_{i=1}^n x_i, \qquad Q_n = \sum_{i=1}^n x_i^2. \] The rules are:

On odd turns \(n\), Alice chooses \(x_n\ge 0\) with \(S_n\le \lambda n\).

On even turns \(n\), Bazza chooses \(x_n\ge 0\) with \(Q_n\le n\).

If a player cannot make a legal move, the game ends and the other wins. If it continues forever, the result is a draw (no winner).

Two elementary lemmas

Lemma 1. After any even turn \(n\), we have \(S_n\le n\) and \(Q_n\le n\).

Proof. The condition for even \(n\) is \(Q_n\le n\). By the Cauchy-Schwarz inequality,

\[ S_n^2 \le n\cdot Q_n \le n\cdot n = n^2, \] hence \(S_n\le n\).

Lemma 2. Suppose that on all odd turns up to \(2M\) Alice plays \(0\) (so the only nonzero numbers are Bazza's choices on even turns). Then after turn \(2M\) we have

\[ S_{2M}\le M\sqrt{2}. \] Proof. Write \(y_i=x_{2i}\) for \(i=1,\dots,M\). Then

\[ S_{2M} = \sum_{i=1}^M y_i, \qquad Q_{2M} = \sum_{i=1}^M y_i^2. \] By Cauchy-Schwarz,

\[ S_{2M}^2 \le M\cdot Q_{2M}. \] Lemma 1 with \(n=2M\) gives \(Q_{2M}\le 2M\). Therefore

\[ S_{2M}^2 \le M\cdot 2M = 2M^2 \quad\Longrightarrow\quad S_{2M}\le M\sqrt{2}. \quad\square \]
1. The case \(\lambda > \dfrac{1}{\sqrt{2}}\) - Alice wins

Alice will force a win in a finite number of moves. Choose an integer \(M\) large enough so that

\[ \lambda(2M+1)-M\sqrt{2} > \sqrt{2}. \quad\text{(1)} \] (Such \(M\) exists because \(\lambda > 1/\sqrt{2}\) implies \(2\lambda-\sqrt{2}>0\), so the left-hand side tends to \(+\infty\) as \(M\to\infty\).) Her strategy is:

On turns \(1,3,5,\dots,2M-1\) (all odd turns before \(2M+1\)) she plays \(x_n=0\).

On turn \(2M+1\) she plays \(x_{2M+1} = \lambda(2M+1)-S_{2M}\).

We must check that the zeros are legal and that the move on turn \(2M+1\) is well-defined.

Legality of the zeros

After each even turn \(2k\) (\(1\le k\le M\)), by Lemma 2 we have \(S_{2k}\le k\sqrt{2}\). For the odd turn \(2k+1\), Alice wants to choose \(0\); this is allowed iff

\[ S_{2k}+0 \le \lambda(2k+1). \] Since \(S_{2k}\le k\sqrt{2}\), it suffices to show \(k\sqrt{2} < \lambda(2k+1)\). Rewrite as \(\lambda > \dfrac{k\sqrt{2}}{2k+1}\). The function \(k\mapsto \dfrac{k\sqrt{2}}{2k+1}\) increases with \(k\) (its limit is \(\sqrt{2}/2 = 1/\sqrt{2}\)). Because \(\lambda > 1/\sqrt{2}\), we have \(\lambda > \dfrac{k\sqrt{2}}{2k+1}\) for every \(k\); hence \(k\sqrt{2} < \lambda(2k+1)\). Thus each \(0\) is legal.

The decisive move

After turn \(2M\), Lemma 2 gives \(S_{2M}\le M\sqrt{2}\). Define

\[ a = x_{2M+1} = \lambda(2M+1)-S_{2M}. \] From (1) and the bound on \(S_{2M}\),

\[ a \ge \lambda(2M+1)-M\sqrt{2} > \sqrt{2} > 0, \] so \(a\) is nonnegative and satisfies \(S_{2M}+a = \lambda(2M+1)\), hence the sum constraint on turn \(2M+1\) is met.

Now we analyze the sum of squares after this move. Let \(S = S_{2M}\). Then

\[ Q_{2M+1} = Q_{2M} + a^2. \] By Cauchy-Schwarz applied to the \(M\) numbers \(x_2,x_4,\dots,x_{2M}\) we have

\[ S^2 \le M\cdot Q_{2M} \quad\Longrightarrow\quad Q_{2M} \ge \frac{S^2}{M}. \] Therefore

\[ Q_{2M+1} \ge \frac{S^2}{M} + a^2 = \frac{S^2}{M} + \bigl(\lambda(2M+1)-S\bigr)^2. \] Define the function

\[ f(S) = \frac{S^2}{M} + \bigl(\lambda(2M+1)-S\bigr)^2, \qquad 0\le S\le M\sqrt{2}. \] We need a lower bound for \(f(S)\).

Monotonicity of \(f\). Compute

\[ f'(S) = \frac{2S}{M} - 2\bigl(\lambda(2M+1)-S\bigr) = 2\Bigl( S\Bigl(1+\frac{1}{M}\Bigr) - \lambda(2M+1)\Bigr), \qquad f''(S)=\frac{2}{M}+2>0. \] Thus \(f'\) is strictly increasing. The critical point \(f'(S)=0\) gives

\[ S_0 = \frac{M\cdot \lambda(2M+1)}{M+1}. \] Because \(\lambda > 1/\sqrt{2}\), we have \(2\lambda > \sqrt{2}\), and for sufficiently large \(M\) (which we may assume)

\[ S_0 > M\sqrt{2}. \] (Simply check that \(S_0 > M\sqrt{2} \iff \lambda(2M+1) > \sqrt{2}(M+1)\), which holds for large \(M\) since the left grows like \(2\lambda M\) and the right like \(\sqrt{2} M\).)

Since \(f'\) is increasing and \(S_0 > M\sqrt{2}\), we have \(f'(S) < f'(S_0)=0\) for all \(S\le M\sqrt{2}\). Hence \(f\) is strictly decreasing on \([0,M\sqrt{2}]\). Consequently its minimum on the interval is attained at \(S = M\sqrt{2}\):

\[ \min_{0\le S\le M\sqrt{2}} f(S) = f(M\sqrt{2}) = \frac{(M\sqrt{2})^2}{M} + \bigl(\lambda(2M+1)-M\sqrt{2}\bigr)^2 = 2M + \bigl(\lambda(2M+1)-M\sqrt{2}\bigr)^2. \] Thus

\[ Q_{2M+1} \ge 2M + \bigl(\lambda(2M+1)-M\sqrt{2}\bigr)^2. \] But condition (1) says \(\lambda(2M+1)-M\sqrt{2} > \sqrt{2}\), so

\[ \bigl(\lambda(2M+1)-M\sqrt{2}\bigr)^2 > 2. \] Therefore

\[ Q_{2M+1} > 2M + 2. \] Now it is Bazza's turn (turn \(2M+2\)). He must choose \(x_{2M+2}\ge 0\) such that

\[ Q_{2M+2} = Q_{2M+1} + x_{2M+2}^2 \le 2M+2. \] Even if he plays \(x_{2M+2}=0\), we obtain \(Q_{2M+2}=Q_{2M+1} > 2M+2\), which violates the constraint. Hence Bazza has no legal move, and Alice wins.

2. The case \(\lambda < \dfrac{1}{\sqrt{2}}\) - Bazza wins

Bazza will use the following strategy on every even turn \(n\):

\[ x_n = \sqrt{\,n - Q_{n-1}\,}. \] In words, he takes the largest possible number that still keeps the sum of squares at most \(n\). We will prove by induction that after each of his moves (i.e., after turn \(2m\)) we have

\[ \text{(i) } Q_{2m}=2m, \qquad \text{(ii) } S_{2m} \ge m\sqrt{2}. \quad\text{(2)} \] Base case \(m=1\) (turn \(2\)). After turn 1, Alice has chosen some \(a_1\ge 0\) with \(a_1\le \lambda\). Then

\[ x_2 = \sqrt{2 - a_1^2} \] (which is real because \(a_1^2 \le \lambda^2 < 1/2 < 2\)). We get

\[ Q_2 = a_1^2 + (2 - a_1^2) = 2. \] For the sum,

\[ S_2 = a_1 + \sqrt{2 - a_1^2}. \] Squaring gives

\[ S_2^2 = a_1^2 + (2 - a_1^2) + 2a_1\sqrt{2 - a_1^2} = 2 + 2a_1\sqrt{2 - a_1^2} \ge 2, \] so \(S_2 \ge \sqrt{2}\). Thus (2) holds for \(m=1\).

Inductive step. Assume (2) is true for \(m-1\), i.e., after turn \(2(m-1)\) we have

\[ Q_{2(m-1)} = 2(m-1), \qquad S_{2(m-1)} \ge (m-1)\sqrt{2}. \] Turn \(2m-1\) (odd): Alice chooses \(a \ge 0\) with \[ S_{2(m-1)} + a \le \lambda(2m-1). \quad\text{(3)} \] Turn \(2m\) (even): Bazza computes

\[ x_{2m} = \sqrt{2m - Q_{2m-1}}. \] First we verify that the square root is defined, i.e., \(Q_{2m-1} \le 2m\).

We have

\[ Q_{2m-1} = Q_{2(m-1)} + a^2 = 2(m-1) + a^2. \] Hence we need \(a^2 \le 2\), or \(a \le \sqrt{2}\). To see that this always holds, use (3) and the inductive lower bound on \(S_{2(m-1)}\):

\[ a \le \lambda(2m-1) - S_{2(m-1)} \le \lambda(2m-1) - (m-1)\sqrt{2}. \quad\text{(4)} \] We claim that the right-hand side of (4) is at most \(\sqrt{2}\). Indeed,

\[ \lambda(2m-1) - (m-1)\sqrt{2} \le \sqrt{2} \;\Longleftrightarrow\; \lambda(2m-1) \le m\sqrt{2}. \] Because \(\lambda < 1/\sqrt{2}\), we have \(2\lambda < \sqrt{2}\). Then

\[ \lambda(2m-1) = 2\lambda m - \lambda \le \sqrt{2}\,m - \lambda < \sqrt{2}\,m, \] so the inequality holds (the left side is \(2\lambda m - \lambda\), the right side is \(\sqrt{2}\,m\); since \(2\lambda m \le \sqrt{2}\,m\), we get \(\lambda(2m-1) \le \sqrt{2}\,m\). More formally: \[ \lambda(2m-1) \le \sqrt{2}\,m \;\Longleftrightarrow\; (2\lambda - \sqrt{2})m \le \lambda. \] The left-hand side is \(\le 0\) (because \(2\lambda - \sqrt{2} < 0\)), while the right-hand side is positive, so the inequality is true for all \(m\ge 1\). Therefore \(a \le \sqrt{2}\), so \(a^2 \le 2\), and the square root is defined.

Now compute:

\[ x_{2m} = \sqrt{2m - \bigl(2(m-1) + a^2\bigr)} = \sqrt{2 - a^2}. \] Then

\[ Q_{2m} = Q_{2m-1} + x_{2m}^2 = \bigl(2(m-1) + a^2\bigr) + (2 - a^2) = 2m. \] For the sum:

\[ S_{2m} = S_{2(m-1)} + a + \sqrt{2 - a^2}. \] Observe that for any \(a\) with \(0\le a\le \sqrt{2}\),

\[ \bigl(a + \sqrt{2 - a^2}\bigr)^2 = 2 + 2a\sqrt{2 - a^2} \ge 2, \] hence \(a + \sqrt{2 - a^2} \ge \sqrt{2}\). Using the inductive bound \(S_{2(m-1)} \ge (m-1)\sqrt{2}\), we obtain

\[ S_{2m} \ge (m-1)\sqrt{2} + \sqrt{2} = m\sqrt{2}. \] This completes the induction.

Alice loses

From (2) we have \(S_{2m} \ge m\sqrt{2}\) for every \(m\). Since \(\lambda < 1/\sqrt{2}\), we have \(\sqrt{2} - 2\lambda > 0\). Choose \(m\) large enough so that \[ m\sqrt{2} > \lambda(2m+1). \quad\text{(5)} \] (Such \(m\) exists because \(m(\sqrt{2} - 2\lambda) > \lambda\) eventually holds.)

Consider turn \(2m+1\). After turn \(2m\),

\[ S_{2m} \ge m\sqrt{2} > \lambda(2m+1) \] by (5). Therefore, even if Alice tries to play \(x_{2m+1}=0\), we have \[ S_{2m+1} = S_{2m} > \lambda(2m+1), \] which violates the sum constraint. Consequently she has no legal move, and Bazza wins.

3. The case \(\lambda = \dfrac{1}{\sqrt{2}}\) - Draw

We show that neither player has a winning strategy by exhibiting a strategy for each that prevents the opponent from winning.

Bazza prevents Alice from winning

Bazza uses the same maximal strategy as in case 2: on each even turn \(n\), set \(x_n = \sqrt{n - Q_{n-1}}\). We check that the induction in case 2 still works when \(\lambda = 1/\sqrt{2}\).

For the inductive step, from (3) and the lower bound \(S_{2(m-1)} \ge (m-1)\sqrt{2}\) we obtain

\[ a \le \lambda(2m-1) - (m-1)\sqrt{2}. \] With \(\lambda = 1/\sqrt{2}\), \[ \lambda(2m-1) - (m-1)\sqrt{2} = \frac{2m-1}{\sqrt{2}} - (m-1)\sqrt{2} = \frac{2m-1 - 2(m-1)}{\sqrt{2}} = \frac{1}{\sqrt{2}}. \] Thus \(a \le 1/\sqrt{2} < \sqrt{2}\), so \(a^2 \le 1/2\), and the square root \(\sqrt{2 - a^2}\) is well-defined. The rest of the induction is unchanged, yielding

\[ Q_{2m}=2m, \qquad S_{2m} \ge m\sqrt{2} \quad\text{for all } m. \quad\text{(6)} \] Now consider any odd turn \(2m+1\). Alice must choose \(a' \ge 0\) such that

\[ S_{2m} + a' \le \lambda(2m+1) = \dfrac{2m+1}{\sqrt{2}}. \] From (6), \(S_{2m} \ge m\sqrt{2} = \dfrac{2m}{\sqrt{2}}\). Therefore \[ a' \le \frac{2m+1}{\sqrt{2}} - S_{2m} \le \frac{2m+1}{\sqrt{2}} - \frac{2m}{\sqrt{2}} = \frac{1}{\sqrt{2}}. \] Consequently \(a'^2 \le \dfrac{1}{2}\), and

\[ Q_{2m+1} = Q_{2m} + a'^2 = 2m + a'^2 \le 2m + \frac{1}{2} < 2m+2. \] Thus after Alice's move, we have \(Q_{2m+1} < 2m+2\). Bazza can then reply with \(x_{2m+2}=0\) (or any number keeping \(Q_{2m+2} \le 2m+2\)). In particular, Bazza always has a legal move, so Alice cannot force a win.

Alice prevents Bazza from winning

Alice adopts the strategy: on every odd turn she plays \(0\).

Then the only nonzero numbers are Bazza's even-turn choices. By Lemma 2, after turn \(2m\) we have

\[ S_{2m} \le m\sqrt{2}. \] The sum constraint on turn \(2m+1\) is

\[ S_{2m+1} = S_{2m} + x_{2m+1} \le \lambda(2m+1) = \dfrac{2m+1}{\sqrt{2}}. \] Since

\[ S_{2m} \le m\sqrt{2} = \dfrac{2m}{\sqrt{2}} < \dfrac{2m+1}{\sqrt{2}}, \] the choice \(x_{2m+1}=0\) satisfies the inequality. Hence Alice never loses on her turn.

Moreover, with this strategy Bazza cannot force a win, because Alice always has a legal move (namely \(0\)). Therefore Bazza does not possess a winning strategy.

Since both players have strategies that thwart a forced win, the game is a draw; it can also be continued indefinitely (e.g., with Bazza always choosing \(0\) as well). So \(\lambda = 1/\sqrt{2}\) leads to no winner.

Conclusion

We have determined the outcome for all positive \(\lambda\):

\[ \boxed{ \begin{array}{l} \text{Alice has a winning strategy if and only if } \lambda > \dfrac{1}{\sqrt{2}}. \\[6pt] \text{Bazza has a winning strategy if and only if } \lambda < \dfrac{1}{\sqrt{2}}. \\[6pt] \text{When } \lambda = \dfrac{1}{\sqrt{2}}, \text{ the game is a draw (no winner).} \end{array} } \]

Question

Consider a $2025 \times 2025$ grid of unit squares. Matilda wishes to place on the grid some rectangular tiles, possibly of different sizes, such that each side of every tile lies on a grid line and every unit square is covered by at most one tile.

Determine the minimum number of tiles Matilda needs to place so that each row and each column of the grid has exactly one unit square that is not covered by any tile.

Answer
Expert verdict: 0/7

Let \(n = 2025\). The grid consists of \(n^2\) unit squares. We must choose a set of squares to remain uncovered such that each row and each column contains exactly one uncovered square; equivalently, the uncovered squares form a permutation matrix. The remaining \(n^2 - n\) squares must be covered by non-overlapping axis-aligned rectangles (tiles) whose sides lie on the grid lines. The goal is to minimize the number of tiles.

1. Reduction to the diagonal configuration

Let the uncovered square in row \(i\) be at column \(c_i\); then \(c_1, c_2, \dots, c_n\) is a permutation of \(\{1,\dots,n\}\). Consider the column permutation \(\sigma\) defined by \(\sigma(c_i) = i\). Applying \(\sigma\) to the column indices (i.e., renaming column \(j\) to \(\sigma(j)\)) transforms the uncovered squares into the diagonal positions \((i,i)\). The tiling is transformed by moving each tile together with the columns; this does not change the number of tiles, and the covering properties remain valid because the grid structure is preserved (only the labels of columns are changed). Therefore, the minimum number of tiles over all configurations is the same as the minimum over configurations where the uncovered squares are exactly the main diagonal \(\{(i,i) \mid 1\le i\le n\}\).

Consequently, we may assume without loss of generality that the diagonal squares are the only uncovered ones.

2. A construction using \(2n-2\) tiles

We now exhibit a tiling of the board with the diagonal uncovered, using exactly \(2n-2\) rectangles.

\textbf{Lower triangle

(\(i > j\)): For each column \(j = 1, 2, \dots, n-1\), place a vertical tile that covers every cell in column \(j\) whose row index is greater than \(j\). Formally,} \[ R^{(L)}_j = \{(i,j) \mid j+1 \le i \le n\}. \] These \(n-1\) rectangles are pairwise disjoint (they lie in different columns) and cover all squares with \(i>j\).

\textbf{Upper triangle

(\(i < j\)): For each row \(i = 1, 2, \dots, n-1\), place a horizontal tile that covers every cell in row \(i\) whose column index is greater than \(i\):} \[ R^{(U)}_i = \{(i,j) \mid i+1 \le j \le n\}. \] These \(n-1\) rectangles are also pairwise disjoint (they occupy distinct rows) and cover all squares with \(i<j\).

The two families are disjoint because a square with \(i>j\) belongs to some \(R^{(L)}_j\) (column \(j\)) and a square with \(i<j\) belongs to some \(R^{(U)}_i\) (row \(i\)); no square can satisfy both conditions. The diagonal squares \((i,i)\) are not covered by any tile. Thus we have a valid covering of all off-diagonal squares using

\[ k = (n-1)+(n-1) = 2n-2 \] tiles.

3. Lower bound: at least \(2n-2\) tiles

Now take any tiling \(\mathcal{T}\) of the board that leaves exactly the diagonal squares uncovered. Partition the off-diagonal squares into two sets:

\[ L = \{(i,j) \mid i > j\}, \qquad U = \{(i,j) \mid i < j\}. \] Lemma 1. Every tile \(T \in \mathcal{T}\) is entirely contained either in \(L\) or in \(U\).

Proof. Suppose a tile \(T\) contains a square from \(L\) and a square from \(U\). Represent \(T\) as the Cartesian product of an interval of rows and an interval of columns:

\[ T = \{(i,j) \mid a \le i \le b,\; c \le j \le d\}, \] with \(1 \le a \le b \le n\), \(1 \le c \le d \le n\). If the intervals \([a,b]\) and \([c,d]\) intersect, then there exists an integer \(r \in [a,b] \cap [c,d]\), and the square \((r,r)\) belongs to \(T\), contradicting the fact that diagonal squares are uncovered. Hence \([a,b]\) and \([c,d]\) are disjoint.

If \(b < c\), then for any \((i,j) \in T\) we have \(i \le b < c \le j\), so \(i < j\); thus \(T \subseteq U\), contradicting the presence of an \(L\)square.

If \(d < a\), then \(j \le d < a \le i\), so \(i > j\), giving \(T \subseteq L\), contradiction.

Therefore a tile cannot contain squares from both \(L\) and \(U\); it must lie wholly in one of them.

Lemma 2. In the lower triangle \(L\), consider the \(n-1\) cells

\[ D_L = \{(i,i-1) \mid i = 2,3,\dots,n\}. \] No tile that is a subset of \(L\) can contain two distinct cells from \(D_L\).

Proof. Let \(T \subseteq L\) be a tile, so \(T = [a,b] \times [c,d]\). Because \(T \subseteq L\), we have \(i > j\) for every \((i,j) \in T\). In particular, the cell \((a,d)\) (the topmost row and rightmost column of the tile) satisfies \(a > d\).

Assume, for contradiction, that \(T\) contains two distinct cells \((i,i-1)\) and \((j,j-1)\) with \(i < j\). From \((i,i-1) \in T\) we obtain

\[ a \le i \le b,\quad c \le i-1 \le d. \] Since \(a > d\) and \(d \ge i-1\), we have \(a > i-1\), hence \(a \ge i\). Combined with \(a \le i\), we get \(a = i\).

Now \(a = i\) and \(a > d\) imply \(i > d\), i.e., \(d < i\). But \(d \ge i-1\) from the containment, so \(d = i-1\).

Now apply the same reasoning to \((j,j-1) \in T\). We obtain \(a = j\) and \(d = j-1\). But we already have \(a = i\), so \(i = j\), contradicting \(i < j\). Hence \(T\) cannot contain two cells of \(D_L\).

Lemma 3. In the upper triangle \(U\), consider the \(n-1\) cells

\[ D_U = \{(i,i+1) \mid i = 1,2,\dots,n-1\}. \] No tile that is a subset of \(U\) can contain two distinct cells from \(D_U\).

Proof. Let \(T \subseteq U\) be a tile, \(T = [a,b] \times [c,d]\). Since \(T \subseteq U\), we have \(i < j\) for every \((i,j) \in T\). In particular, the cell \((b,c)\) (the bottommost row and leftmost column) satisfies \(b < c\).

Suppose \(T\) contains \((i,i+1)\) and \((j,j+1)\) with \(i < j\). From \((i,i+1) \in T\) we have

\[ a \le i \le b,\quad c \le i+1 \le d. \] Because \(c > b\) and \(b \ge i\), we get \(c > i\), thus \(c \ge i+1\). But \(c \le i+1\) from the containment, so \(c = i+1\).

Moreover, \(c > b \ge i\) and \(c = i+1\) imply \(b < i+1\), i.e., \(b \le i\). Combined with \(i \le b\), we obtain \(b = i\).

Now from \((j,j+1) \in T\) we similarly deduce \(c = j+1\) and \(b = j\). Since \(c = i+1\), we have \(i+1 = j+1\), so \(i = j\), contradiction. Hence \(T\) cannot contain two cells of \(D_U\).

Lower bound argument. The sets \(D_L\) and \(D_U\) each contain \(n-1\) squares, and every square must be covered. By Lemma 1, any tile that covers a square from \(L\) is entirely contained in \(L\); similarly, any tile covering a square from \(U\) is entirely in \(U\).

\(D_L\) must be covered by tiles that lie in \(L\). Lemma 2 tells us that each such tile can cover at most one element of \(D_L\). Therefore at least \(|D_L| = n-1\) tiles are required that belong to \(L\).

\(D_U\) must be covered by tiles that lie in \(U\), and Lemma 3 says each such tile can cover at most one element of \(D_U\), so at least \(n-1\) tiles are needed that belong to \(U\).

A tile cannot be in both \(L\) and \(U\) because \(L\) and \(U\) are disjoint. Hence the total number of tiles is at least

\[ (n-1) + (n-1) = 2n-2. \]
4. Minimum number of tiles

We have shown:

There exists a tiling with \(2n-2\) tiles (Construction).

Any tiling uses at least \(2n-2\) tiles (Lower bound).

Therefore the minimum possible number of tiles is exactly \(2n-2\).

Substituting \(n = 2025\) gives

\[ 2 \times 2025 - 2 = 4050 - 2 = 4048. \] \[ \boxed{4048} \]