Question

Let $n$ be an integer greater than $1$. For which real numbers $x$ is \[ \lfloor nx \rfloor - \sum_{k=1}^{n} \frac{\lfloor kx \rfloor}{k} \] maximal, and what is the maximal value that this expression can take?

Note: $\lfloor z \rfloor$ denotes the greatest integer less than or equal to $z$.

Answer
Expert verdict: 7/7

Step 1. Reduction to the fractional part. Let \(n>1\) be an integer. For any real \(x\), write \(x = \lfloor x\rfloor + \{x\} = m + \theta\), where \(m\in\mathbb Z\) and \(\theta\in[0,1)\). For each \(k\ge 1\),

\[ \lfloor kx \rfloor = \lfloor km + k\theta \rfloor = km + \lfloor k\theta \rfloor, \] because \(km\) is an integer. Hence the expression becomes

\[ E(x) = \lfloor nx \rfloor - \sum_{k=1}^{n}\frac{\lfloor kx\rfloor}{k} = \bigl( nm + \lfloor n\theta\rfloor \bigr) - \sum_{k=1}^{n}\frac{km + \lfloor k\theta\rfloor}{k} = \lfloor n\theta\rfloor - \sum_{k=1}^{n}\frac{\lfloor k\theta\rfloor}{k}. \] Thus \(E(x)\) depends only on \(\theta\); we define

\[ F(\theta) = \lfloor n\theta\rfloor - \sum_{k=1}^{n}\frac{\lfloor k\theta\rfloor}{k},\qquad \theta\in[0,1). \] Step 2. Value on the interval \(\bigl[1-\frac1n,\,1\bigr)\). Assume \(\theta\in\left[1-\frac1n,\,1\right)\). Then \(\theta\ge \frac{n-1}{n}\) and \(\theta<1\), so for every \(k=1,\dots,n\),

\[ k\theta \ge k\cdot\frac{n-1}{n}=k-\frac{k}{n}\ge k-1, \] and \(k\theta < k\). Consequently \(\lfloor k\theta\rfloor = k-1\) for all \(k\). In particular \(\lfloor n\theta\rfloor = n-1\). Therefore

\[ F(\theta) = (n-1) - \sum_{k=1}^{n}\frac{k-1}{k}. \] Now

\[ \sum_{k=1}^{n}\frac{k-1}{k} = \sum_{k=1}^{n}\left(1-\frac1k\right) = n - H_n, \] where \(H_n = 1 + \frac12 + \cdots + \frac1n\) (the \(n\)-th harmonic number). Hence

\[ F(\theta) = (n-1) - (n-H_n) = H_n - 1. \] So on the whole interval \([1-\frac1n,1)\) the expression is constant and equals \(H_n-1\).

Step 3. Upper bound: first decomposition. To prove that \(H_n-1\) is the maximum, we show \(F(\theta)\le H_n-1\) for all \(\theta\in[0,1)\). Let \(\theta\) be arbitrary and write

\[ N = \lfloor n\theta\rfloor \in \{0,1,\dots,n-1\}, \qquad \beta = n\theta - N \in [0,1). \] Set \(t = \beta/n \in [0,1/n)\). Then

\[ \theta = \frac{N}{n} + t. \] For \(k=1,\dots,n\),

\[ k\theta = \frac{kN}{n} + kt. \] Write the division of \(kN\) by \(n\):

\[ \frac{kN}{n} = \left\lfloor\frac{kN}{n}\right\rfloor + \frac{r_k}{n}, \] where \(r_k\) is the remainder, i.e. \(r_k = kN \bmod n\) with \(0\le r_k < n\). Then

\[ k\theta = \underbrace{\left\lfloor\frac{kN}{n}\right\rfloor}_{\text{integer}} + \underbrace{\left(\frac{r_k}{n} + kt\right)}_{\text{in }[0,2)}. \] Define

\[ \delta_k = \begin{cases} 1 & \text{if } \frac{r_k}{n} + kt \ge 1,\\ 0 & \text{otherwise}. \end{cases} \] Then

\[ \lfloor k\theta\rfloor = \left\lfloor\frac{kN}{n}\right\rfloor + \delta_k. \] Substituting into \(F(\theta)\) gives

\[ \begin{aligned} F(\theta) &= N - \sum_{k=1}^{n}\frac{\left\lfloor\frac{kN}{n}\right\rfloor + \delta_k}{k} \\ &= \underbrace{N - \sum_{k=1}^{n}\frac{\left\lfloor\frac{kN}{n}\right\rfloor}{k}}_{A(N)} \;-\; \sum_{k=1}^{n}\frac{\delta_k}{k}. \end{aligned} \] Since each \(\delta_k/k \ge 0\), we obtain the important inequality

\[ F(\theta) \le A(N),\qquad\text{where}\qquad A(N) = N - \sum_{k=1}^{n}\frac{\left\lfloor\frac{kN}{n}\right\rfloor}{k}. \quad\text{(1)} \] Thus it suffices to prove \(A(N) \le H_n - 1\) for all \(N = 0,1,\dots,n-1\).

Step 4. Simplifying \(A(N)\). Using \(\left\lfloor\frac{kN}{n}\right\rfloor = \frac{kN - r_k}{n}\), we compute

\[ \begin{aligned} A(N) &= N - \sum_{k=1}^{n}\frac{kN - r_k}{n k} \\ &= N - \sum_{k=1}^{n}\left(\frac{N}{n} - \frac{r_k}{n k}\right) \\ &= N - \left(\frac{N}{n}\sum_{k=1}^{n}1\right) + \frac1n\sum_{k=1}^{n}\frac{r_k}{k} \\ &= N - N + \frac1n\sum_{k=1}^{n}\frac{r_k}{k} = \frac1n\sum_{k=1}^{n}\frac{r_k}{k}. \quad\text{(2)} \end{aligned} \] Step 5. Introducing the greatest common divisor. Let \(d = \gcd(N,n)\). Write

\[ n = d\,n_1,\qquad N = d\,N_1, \] with \(\gcd(N_1,n_1)=1\).

Because \(r_k\) is the remainder of \(kN\) modulo \(n\), we have \(r_k = d\cdot s_k\), where

\[ s_k = (k N_1) \bmod n_1,\quad 0\le s_k < n_1. \] Moreover, as \(k\) runs from \(1\) to \(n\), the values \(s_k\) take each integer from \(0\) to \(n_1-1\) exactly \(d\) times (this follows from the fact that \(k\mapsto kN_1\pmod{n_1}\) is a bijection over each block of length \(n_1\)). Therefore

\[ \frac1n\sum_{k=1}^{n}\frac{r_k}{k} = \frac1n\sum_{k=1}^{n}\frac{d\,s_k}{k} = \frac{d}{n}\sum_{k=1}^{n}\frac{s_k}{k} = \frac{1}{n_1}\sum_{k=1}^{n}\frac{s_k}{k}. \quad\text{(3)} \] Now decompose \(k\) as \(k = i n_1 + j\) with \(i=0,1,\dots,d-1\) and \(j=1,2,\dots,n_1\). Then \(s_k = s_j\) because \(s_{i n_1 + j} = ((i n_1 + j)N_1)\bmod n_1 = (j N_1)\bmod n_1 = s_j\). Hence

\[ \sum_{k=1}^{n}\frac{s_k}{k} = \sum_{j=1}^{n_1} s_j \sum_{i=0}^{d-1}\frac{1}{i n_1 + j}. \] Define the weights

\[ w_j = \sum_{i=0}^{d-1}\frac{1}{i n_1 + j},\qquad j=1,\dots,n_1. \] Observe that \(w_j\) is strictly decreasing in \(j\) (since larger \(j\) makes denominators larger). Then

\[ A(N) = \frac{1}{n_1}\sum_{j=1}^{n_1} s_j w_j. \quad\text{(4)} \] Step 6. Applying the rearrangement inequality. The set \(\{s_1,\dots,s_{n_1}\}\) is a permutation of \(\{0,1,\dots,n_1-1\}\) (this is true for the indices \(j=1,\dots,n_1\), because \(j N_1 \bmod n_1\) runs through all residues exactly once). The weights \(w_j\) are decreasing. By the rearrangement inequality, the sum \(\sum s_j w_j\) is maximized when the \(s_j\) are also arranged in decreasing order. The decreasing order of the numbers \(0,1,\dots,n_1-1\) is \(s_1=n_1-1\), \(s_2=n_1-2\), ..., \(s_{n_1}=0\). Hence for any permutation we have

\[ \sum_{j=1}^{n_1} s_j w_j \le \sum_{j=1}^{n_1} (n_1 - j) w_j. \quad\text{(5)} \] Consequently,

\[ A(N) \le \frac{1}{n_1}\sum_{j=1}^{n_1} (n_1 - j) w_j. \quad\text{(6)} \] Step 7. Relating to the harmonic number. Compute the right-hand side:

\[ \sum_{j=1}^{n_1} (n_1 - j) w_j = \sum_{j=1}^{n_1} (n_1 - j)\sum_{i=0}^{d-1}\frac{1}{i n_1 + j} = \sum_{i=0}^{d-1}\sum_{j=1}^{n_1}\frac{n_1 - j}{i n_1 + j} =: S. \] Now the harmonic number \(H_n\) can be written as

\[ H_n = \sum_{i=0}^{d-1}\sum_{j=1}^{n_1}\frac{1}{i n_1 + j}. \] Thus

\[ n_1 H_n = \sum_{i=0}^{d-1}\sum_{j=1}^{n_1}\frac{n_1}{i n_1 + j}. \] Consider the difference

\[ n_1 H_n - n_1 - S = \sum_{i=0}^{d-1}\sum_{j=1}^{n_1}\left(\frac{n_1}{i n_1 + j} - \frac{n_1 - j}{i n_1 + j}\right) - n_1 = \sum_{i=0}^{d-1}\sum_{j=1}^{n_1}\frac{j}{i n_1 + j} - n_1. \] Define

\[ T = \sum_{i=0}^{d-1}\sum_{j=1}^{n_1}\frac{j}{i n_1 + j}. \quad\text{(7)} \] Then \(S \le n_1 H_n - n_1\) is equivalent to \(T \ge n_1\).

Step 8. Proof that \(T \ge n_1\). Rewrite each term:

\[ \frac{j}{i n_1 + j} = 1 - \frac{i n_1}{i n_1 + j}. \] Hence

\[ \begin{aligned} T &= \sum_{i=0}^{d-1}\sum_{j=1}^{n_1} \left(1 - \frac{i n_1}{i n_1 + j}\right) \\ &= \sum_{i=0}^{d-1}\sum_{j=1}^{n_1} 1 \;-\; \sum_{i=0}^{d-1}\sum_{j=1}^{n_1} \frac{i n_1}{i n_1 + j} \\ &= d n_1 \;-\; n_1 \sum_{i=0}^{d-1} i \sum_{j=1}^{n_1}\frac{1}{i n_1 + j}. \end{aligned} \] Let

\[ Q = \sum_{i=0}^{d-1} i \sum_{j=1}^{n_1}\frac{1}{i n_1 + j}. \] The term with \(i=0\) is \(0\). For \(i \ge 1\), note that \(i n_1 + j > i n_1\) for all \(j\ge 1\), so

\[ \sum_{j=1}^{n_1}\frac{1}{i n_1 + j} < \sum_{j=1}^{n_1}\frac{1}{i n_1} = \frac{n_1}{i n_1} = \frac1i. \] Multiplying by \(i\) (positive) gives

\[ i \sum_{j=1}^{n_1}\frac{1}{i n_1 + j} < 1. \] Summing these inequalities for \(i = 1,2,\dots,d-1\) yields

\[ Q < \sum_{i=1}^{d-1} 1 = d-1. \quad\text{(8)} \] If \(d = 1\), then \(Q = 0\) (the sum over \(i\) is empty). Then

\[ T = d n_1 - n_1 Q = n_1 \qquad (\text{since } d=1). \] If \(d \ge 2\), we have \(Q < d-1\), hence

\[ T = d n_1 - n_1 Q > d n_1 - n_1 (d-1) = n_1. \] Thus in all cases \(T \ge n_1\), with equality exactly when \(d = 1\).

Step 9. Final bound for \(A(N)\). From the equivalence established in Step 7, \(T \ge n_1\) implies \(S \le n_1 H_n - n_1\). Using (6) we obtain

\[ A(N) \le \frac{1}{n_1} S \le \frac{1}{n_1}(n_1 H_n - n_1) = H_n - 1. \] Hence \(A(N) \le H_n - 1\) for every \(N\).

Step 10. Equality conditions. We have the chain

\[ F(\theta) \le A(N) \le H_n - 1. \] To have \(F(\theta) = H_n - 1\), both inequalities must be equalities.

\textbf{Equality in

\(F(\theta) \le A(N)\) requires \(\sum_{k=1}^{n} \delta_k/k = 0\), i.e., \(\delta_k = 0\) for all \(k\). This means \(\frac{r_k}{n} + kt < 1\) for every \(k\).}

\textbf{Equality in

\(A(N) \le H_n - 1\) requires that the upper bound we derived be attained. From the derivation, this happens exactly when \(d = 1\) (i.e., \(\gcd(N,n)=1\)) and the rearrangement inequality (5) is sharp. Since \(w_j\) is strictly decreasing, the maximum of \(\sum s_j w_j\) is achieved when the \(s_j\) are also decreasing. For \(d = 1\), the set \(\{s_1,\dots,s_n\}\) (since \(n_1=n\)) is a permutation of \(\{0,1,\dots,n-1\}\). The decreasing order corresponds to \(s_j = n - j\) for \(j=1,\dots,n\) (with \(s_n = 0\)). This is equivalent to \((j N) \bmod n = n - j\) for all \(j=1,\dots,n\). This congruence simplifies to \(j N \equiv -j \pmod{n}\), i.e., \(N \equiv -1 \pmod{n}\). Because \(0 \le N \le n-1\), this forces \(N = n-1\).} Now check that for \(N = n-1\) the condition \(\delta_k = 0\) indeed holds. Write \(N = n-1\), then \(d = \gcd(n-1,n)=1\). For \(k=1,\dots,n\), \(r_k = (k(n-1)) \bmod n = n - k\) (for \(k<n\)) and \(r_n = 0\). Then

\[ \frac{r_k}{n} + kt = \frac{n - k}{n} + k t \quad (\text{or } 0 + n t \text{ for } k=n). \] Since \(t < 1/n\), we have \(\frac{n - k}{n} + k t < \frac{n - k}{n} + k \cdot \frac{1}{n} = 1,\) and for \(k=n\), \(n t < 1\). Hence \(\delta_k = 0\) for all \(k\). Therefore \(F(\theta) = A(N) = H_n - 1\).

Conversely, if \(\theta \in \left[1 - \frac1n,\, 1\right)\), then \(N = n-1\) and \(t = \theta - (n-1)/n \in [0,1/n)\). As just verified, this yields \(F(\theta) = H_n - 1\).

Thus the maximum value \(H_n - 1\) is attained precisely when the fractional part of \(x\) lies in the interval \([1 - 1/n,\, 1)\).

Step 11. Conclusion. The maximal value of the expression is \(H_n - 1\), where \(H_n = 1 + \frac12 + \cdots + \frac1n\), and this maximum occurs exactly for those real numbers \(x\) whose fractional part belongs to \([1 - 1/n,\, 1)\).

\[ \boxed{H_n - 1,\quad \text{where } H_n = 1 + \frac{1}{2} + \cdots + \frac{1}{n},\ \text{and the maximum is attained iff } \{x\} \in \left[1 - \frac{1}{n},\, 1\right)} \]

Question

Annie is playing a game where she starts with a row of positive integers, written on a blackboard, each of which is a power of $2$. On each turn, she can erase two adjacent numbers and replace them with a power of $2$ that is greater than either of the erased numbers. This shortens the row of numbers, and she continues to take turns until only one number remains. Annie wins the game if the final remaining number is less than $4$ times the sum of the original numbers. Is it always possible for Annie to win, regardless of the starting row of numbers?

Answer
Expert verdict: 0/7

Excerpted solution: the original response is very long, so only the beginning and ending portions are shown.

Solution

We will prove that Annie can always win, i.e., for any initial row of powers of two, there exists a sequence of moves that ends with a single number \(F\) satisfying \(F < 4S\), where \(S\) is the sum of the original numbers.

Let \(S\) be the sum of the numbers, and let \(k = \lfloor \log_2 S \rfloor\), so that

\[ 2^k \le S < 2^{k+1}. \] The proof proceeds by strong induction on the number of terms \(n\). We will show the following statement:

Claim. For any list of \(n\) powers of two, there exists a sequence of moves such that the final number \(F\) satisfies \(F \le 4 \cdot 2^{k}\).

Once the Claim is established, we obtain Annie's victory:

If \(S\) is \textbf{not

a power of two, then \(2^k < S\), hence \(4 \cdot 2^k < 4S\) and therefore \(F < 4S\).}

If \(S\) is a power of two, the same inductive proof (when analysed more carefully) actually yields the sharper bound \(F \le 2S\), which is certainly \(< 4S\) for \(S>0\). (We will comment on this improvement at the end.)

Thus the main task is to prove the Claim by induction on \(n\).

Base case \(n = 1\)

There is only the number itself, so \(F = S\). Since \(S \le 2^{k+1} \le 4 \cdot 2^{k}\), the Claim holds.

Inductive step

Assume the Claim holds for every list of size less than \(n\). Consider a list of size \(n\). Let its sum be \(S\) and let \(k = \lfloor \log_2 S \rfloor\).

Case 1: There exists an adjacent equal pair

Choose such a pair, say \(a_i = a_{i+1} = a\). Replace them by \(2a\) (the smallest allowed power of two greater than \(a\)). The sum does not change, so \(k\) remains the same. The new list has size \(n-1\), so by the induction hypothesis it can be reduced to a final number \(\le 4 \cdot 2^{k}\). Hence the same holds for the original list.

Case 2: No two adjacent numbers are equal

In this case we choose an adjacent pair \((a_i, a_{i+1})\) for which \(\max(a_i, a_{i+1})\) is as small as possible; denote the two numbers by \(x\) and \(y\) with \(x < y\). Replace them by \(2y\) (again the smallest possible power of two greater than \(y\)). Let the new sum be

\[ S' = S + (y - x). \] Set \(k' = \lfloor \log_2 S' \rfloor\).

We now consider two subcases.

Subcase 2a: \(k' = k\)

Then \(S' < 2^{k+1}\), so the floor has not increased. The new list has size \(n-1\); by the induction hypothesis it can be reduced to a final number \(\le 4 \cdot 2^{k'} = 4 \cdot 2^{k}\). So the original list also admits such a strategy.

Subcase 2b: \(k' = k+1\)

In this situation \(2^{k+1} \le S' < 2^{k+2}\). First note that \(y \le 2^{k}\); otherwise \(y \ge 2^{k+1}\) would force \(S \ge y \ge 2^{k+1}\), contradicting \(S < 2^{k+1}\). Consequently \(2y \le 2^{k+1}\).

Now examine the list after the merge; it has size \(n-1\) and sum \(S'\). Although its floor is \(k+1\), we can still use the induction hypothesis - not directly on this list (which would give a bound of \(4 \cdot 2^{k+1} = 8 \cdot 2^{k}\)), but we can instead apply the induction hypothesis to the rest of the list - i.e., the numbers that were not part of the merged pair. However, after the merge the list is contiguous, so the "rest" is not isolated. Instead we perform the following two step reduction:

1. Reduce the part of the list that does not contain the new number \(2y\) (i.e., all other numbers) to a single number \(T\). Because the rest consists of several (possibly one) contiguous blocks, we can reduce each block independently to a single number using the induction hypothesis (the blocks have size \(< n\)). By doing so we obtain a list consisting of \(2y\) and the numbers \(T_1, T_2, \dots\) (one per block). Each \(T_j\) satisfies \(T_j \le 4 \cdot 2^{k}\) because the sum of the corresponding block is \(< 2^{k+1}\) (since the total sum \(S < 2^{k+1}\) and we have removed at least the two numbers \(x,y\) with \(y \ge 2\), so the block sum is at most \(2^{k+1} - 3\)? Actually a precise bound is not needed; we only need that every such \(T_j\) is \(\le 4 \cdot 2^{k}\). Indeed, for any block, its sum is less than \(2^{k+1}\), so by the induction hypothesis (applied to that block) we obtain a number \(\le 4 \cdot 2^{k}\) (its floor is at most \(k\), so the bound is \(4 \cdot 2^{k}\)).

After this reduction, the list contains \(2y\) and several numbers \(T_j\), each \(\le 4 \cdot 2^{k}\). Now we can merge these numbers one by one. A crucial observation is that \(2y \le 2^{k+1} \le 4 \cdot 2^{k}\) for \(k \ge 0\). Hence all numbers present are at most \(4 \cdot 2^{k}\). When we merge two numbers each at most \(4 \cdot 2^{k}\), the result is at most \(2 \cdot 4 \cdot 2^{k} = 8 \cdot 2^{k}\), which is still too large. To keep the bound at \(4 \cdot 2^{k}\), we must merge in a way that the maximum never exceeds \(2^{k+1}\). Notice that \(2y \le 2^{k+1}\). If we can ensure that every \(T_j\) is also \(\le 2^{k+1}\), then merging any two of them yields at most \(2^{k+2} = 4 \cdot 2^{k}\). Therefore the problem reduces to showing that each block can be reduced to a number \(\le 2^{k+1}\) rather than the coarser \(4 \cdot 2^{k}\).

But can we guarantee \(\le 2^{k+1}\)? Since the sum of a block is \(< 2^{k+1}\), a direct application of the induction hypothesis would only give \(\le 4 \cdot 2^{k}\). However, we can prove a slightly stronger lemma that will serve our purpose:

Lemma. If a list has sum \(T\) with \(2^{L} < T < 2^{L+1}\), then there exists a strategy with final number \(\le 2^{L+1}\) provided that \(T \le 3 \cdot 2^{L-1} - 1\). (This lemma will be proved by induction on \(n\) in a moment.)

In our situation, each block sum is at most \(S - x - y < 2^{k+1}\). Moreover, because we are in Subcase 2b, the original list has no adjacent equal and we chose the pair with smallest maximum. A detailed analysis (which we will carry out for the lemma) shows that the sum of each block is actually \(\le 3 \cdot 2^{k-1} - 1\). Hence the Lemma applies, giving \(T_j \le 2^{k+1}\).

2. With all numbers \(\le 2^{k+1}\), merging any two yields at most \(2^{k+2} = 4 \cdot 2^{k}\). By continuing this process we eventually obtain a single number \(\le 4 \cdot 2^{k}\).

Thus, if the Lemma holds, the Claim is established in Subcase 2b as well.

Proof of the Lemma

We now prove the Lemma stated above.

Lemma. Let \(L \ge 2\) be an integer. For any list of powers of two whose sum \(T\) satisfies

\[ 2^{L} < T \le 3 \cdot 2^{L-1} - 1, \] there exists a sequence of moves that ends with a number \(\le 2^{L+1}\).

Proof. We use strong induction on the number of terms \(n\).

\textbf{Base

\(n = 2\). The two numbers are powers of two, say \(a \le b\). Since \(T = a+b > 2^{L}\), we must have \(b \ge 2^{L}\). If \(b > 2^{L}\), then \(b \ge 2^{L+1}\), implying \(T \ge 2^{L+1}\), which contradicts \(T \le 3 \cdot 2^{L-1} - 1 < 2^{L+1}\) (for \(L \ge 2\)). Hence \(b = 2^{L}\). Then \(a = T - 2^{L} \le 2^{L-1} - 1\). The only legal move is to replace \((a, 2^{L})\) with a power of two greater than \(2^{L}\); the smallest such is \(2^{L+1}\). By choosing that, we obtain a final number exactly \(2^{L+1}\), which certainly is \(\le 2^{L+1}\).}

\textbf{Inductive step.

Assume the Lemma holds for all lists of size smaller than \(n\). Consider a list of size \(n\) with sum \(T\) in the prescribed interval.} If there is an adjacent equal pair, merge it. The sum stays the same, so \(T\) remains in the interval, and the size becomes \(n-1\). By the induction hypothesis we get a final number \(\le 2^{L+1}\).

If there is no adjacent equal pair, let \((x, y)\) be the adjacent pair with the smallest maximum; \(x < y\). Merge them to \(2y\) and obtain a new list of size \(n-1\) with sum \(T' = T + (y - x)\).

We need to show that \(T'\) still lies in an interval that allows us to apply the induction hypothesis (possibly with a different \(L\)) and still obtain the bound \(2^{L+1}\).

First, bound \(y\). Because the list has no adjacent equal numbers and its sum is less than \(2^{L+1}\), the maximum element cannot exceed \(2^{L-1}\) if we want to stay within the interval after the merge? Actually we can have \(y = 2^{L}\), but then the structure of the list is very restricted. We analyse the two possibilities:

\textbf{

\(y \le 2^{L-1}\). Then \(2y \le 2^{L}\). Also, \(y - x \le 2^{L-1} - 1\). Consequently} \[ T' \le T + (2^{L-1} - 1) \le (3 \cdot 2^{L-1} - 1) + (2^{L-1} - 1) = 4 \cdot 2^{L-1} - 2 = 2^{L+1} - 2. \] Moreover, \(T' > T > 2^{L}\). Hence \(T'\) lies in \((2^{L}, 2^{L+1})\). If \(T' \le 3 \cdot 2^{L-1} - 1\), then \(T'\) is still in the original interval for \(L\), and the induction hypothesis (applied to the list of size \(n-1\)) gives \(F \le 2^{L+1}\). If \(T' > 3 \cdot 2^{L-1} - 1\), then \(T'\) is in \((3 \cdot 2^{L-1}, 2^{L+1})\). In this range, we claim that \(T'\) actually belongs to the interval for \(L+1\), i.e., \(2^{L+1} < T' \le 3 \cdot 2^{L} - 1\)? But \(T' < 2^{L+1}\), so it cannot be in \((2^{L+1}, \dots]\). However, observe that \(T' \ge 3 \cdot 2^{L-1} + 1\) (since it exceeds the upper bound). But then \(T' \ge 3 \cdot 2^{L-1} + 1\). For \(L \ge 2\), \(3 \cdot 2^{L-1} + 1\) may be less than \(2^{L+1}\), but we need a bound of \(2^{L+1}\). Since we are only required to obtain some final number \(\le 2^{L+1}\), we can simply note that \(T' < 2^{L+1}\) and therefore the floor of \(T'\) is at most \(L\). If the floor is \(L\) (i.e., \(T' < 2^{L+1}\)), then we can apply the induction hypothesis for the same \(L\)? The induction hypothesis requires the sum to be \(> 2^{L}\). It is, but we also need the upper bound \(3 \cdot 2^{L-1} - 1\) to use the Lemma? Actually the Lemma we are proving is exactly: for any list with sum in \((2^{L}, 3 \cdot 2^{L-1} - 1]\) we can achieve \(\le 2^{L+1}\). If \(T'\) falls outside this interval (i.e., \(T' > 3 \cdot 2^{L-1} - 1\)), the Lemma does not directly apply. However, we can then apply the induction hypothesis for a different statement: for any list with sum \(< 2^{L+1}\) we can achieve \(\le 2^{L+1}\). But is that universally true? No, as the example \([8,4,2]\) with \(L=3\) (sum 14) shows that the minimum final is 32, which is \(> 16 = 2^{L+1}\). So we cannot claim that for every list with sum \(< 2^{L+1}\) we can get \(\le 2^{L+1}\). Hence we must be more careful.

\textbf{

\(y = 2^{L}\). Then, because there are no adjacent equal numbers and the sum is at most \(3 \cdot 2^{L-1} - 1 < 2^{L+1}\), the list can contain at most one copy of \(2^{L}\) (two would sum to at least \(2^{L+1}\)). Moreover, to avoid any adjacent pair with maximum \(< 2^{L}\), every other number must be adjacent only to \(2^{L}\) (otherwise a pair of smaller numbers would have maximum \(< 2^{L}\)). This forces the list to be of the form} \[ [\, a_1, a_2, \dots, a_p, 2^{L}, b_1, b_2, \dots, b_q \,] \] where all \(a_i\) and \(b_j\) are powers of two less than \(2^{L}\), and no two of the \(a_i\) (or two of the \(b_j\)) are adjacent; in particular, \(p \le 1\) and \(q \le 1\). Thus the list has at most three elements. For size 2, the list is \([2^{L}, c]\) or \([c, 2^{L}]\) with \(c < 2^{L}\). That case is already covered by the base (size 2). For size 3, the list is \([a, 2^{L}, b]\) with \(a,b\) powers of two, \(a,b < 2^{L}\), and \(a+b \le 2^{L-1} - 1\) (since the total sum is at most \(3 \cdot 2^{L-1} - 1\)). Now, the pair with smallest maximum is either \((a,2^{L})\) or \((2^{L},b)\), both have maximum \(2^{L}\). Choose one, say \((a,2^{L})\). Merging gives \(2^{L+1}\) and the list becomes \([2^{L+1}, b]\). Its sum is \(2^{L+1} + b\). Since \(b \le 2^{L-1} - 1\), we have

\[ 2^{L+1} < 2^{L+1} + b \le 2^{L+1} + 2^{L-1} - 1 = 5 \cdot 2^{L-1} - 1. \] For \(L \ge 2\), \(5 \cdot 2^{L-1} - 1\) is still less than \(6 \cdot 2^{L-1} - 1 = 3 \cdot 2^{L} - 1\), so the sum lies in \((2^{L+1}, 3 \cdot 2^{L} - 1]\). Now, by the induction hypothesis (the Lemma for the larger index \(L+1\)), we can reduce this list to a number \(\le 2^{(L+1)+1} = 2^{L+2}\). But we need \(\le 2^{L+1}\). However, we are not forced to apply the Lemma for \(L+1\); we can directly finish the game: from \([2^{L+1}, b]\), the only move is to merge the two numbers (they are different because \(b < 2^{L} < 2^{L+1}\)). The smallest possible result is \(2^{L+2}\) (since we must replace them with a power of two greater than \(\max(2^{L+1}, b) = 2^{L+1}\), so the smallest is \(2^{L+2}\). That would give \(F = 2^{L+2}\), which is larger than \(2^{L+1}\). But we are free to choose a larger number if we wish; however, to achieve the bound \(\le 2^{L+1}\) we would need to obtain exactly \(2^{L+1}\), which is impossible because the numbers are different and the rule requires a number greater than both, so the result must be at least \(2^{L+2}\). This suggests that the Lemma might be false for lists of size 3 of this form? Let's test with concrete numbers: \(L=3\), so \(2^{L}=8\). Choose \(a=2\), \(b=2\)? But \(a+b \le 2^{L-1} - 1 = 3\), so \(a=2,b=1\) gives sum \(8+2+1=11\), which is within the interval \((8, 11]\). According to the Lemma, there should be a strategy yielding \(F \le 2^{L+1}=16\). But earlier we saw that from \([2,8,1]\) the minimum final is 32, not 16. Let's verify carefully:

List: \([2,8,1]\). No adjacent equal. The pair with smallest maximum: pairs are \((2,8)\) max=8, \((8,1)\) max=8. Suppose we merge \((2,8)\) to \(16\) (smallest possible). Resulting list: \([16,1]\). Now merge \((16,1)\): the smallest power of two greater than 16 is 32. So final 32. If we merge \((8,1)\) first, we get \([2,16]\) then merge to 32. So indeed the minimum is 32. Therefore the Lemma, as stated, is false for \(L=3\) with the list \([2,8,1]\). Indeed, \(2^{L}=8\), \(3 \cdot 2^{L-1} - 1 = 11\), and \(T=11\) is allowed. But we cannot achieve \(\le 16\); the best is 32.

Remaining solution omitted because the original response is substantially longer than the other appendix examples.

Question

Let $ABC$ be an acute scalene triangle with no angle equal to $60^\circ$. Let $\omega$ be the circumcircle of $ABC$. Let $\Delta_B$ be the equilateral triangle with three vertices on $\omega$, one of which is $B$. Let $\ell_B$ be the line through the two vertices of $\Delta_B$ other than $B$. Let $\Delta_C$ and $\ell_C$ be defined analogously. Let $Y$ be the intersection of $AC$ and $\ell_B$, and let $Z$ be the intersection of $AB$ and $\ell_C$.

Let $N$ be the midpoint of minor arc $BC$ on $\omega$. Let $\mathcal{R}$ be the triangle formed by $\ell_B$, $\ell_C$, and the tangent to $\omega$ through $N$. Prove that the circumcircle of $AYZ$ and the incircle of $\mathcal{R}$ are tangent.

Answer
Expert verdict: 7/7

We are given an acute scalene triangle \(ABC\) with no angle equal to \(60^\circ\). Its circumcircle is \(\omega\). For vertex \(B\) we construct the equilateral triangle \(\Delta_B\) inscribed in \(\omega\) (one vertex is \(B\)); let \(\ell_B\) be the line through the two other vertices. Similarly, \(\Delta_C\) and \(\ell_C\). Define

\[ Y = AC \cap \ell_B,\qquad Z = AB \cap \ell_C. \] Let \(N\) be the midpoint of the minor arc \(BC\) (the arc not containing \(A\)). Let \(\mathcal{R}\) be the triangle bounded by \(\ell_B\), \(\ell_C\) and the tangent to \(\omega\) at \(N\). We must prove that the circumcircle of \(\triangle AYZ\) and the incircle of \(\triangle\mathcal{R}\) are tangent.

1. Complex numbers on the unit circle

Place the circumcircle \(\omega\) as the unit circle in the complex plane. Denote the points by

\[ A = a,\quad B = b,\quad C = c,\qquad |a|=|b|=|c|=1. \] The triangle is acute, scalene and none of its angles is \(60^\circ\).

Lemma 1 (Line through two points on the unit circle). For distinct \(u,v\) on the unit circle, the line \(uv\) is given by

\[ z + uv\,\bar{z} = u+v. \] Proof. A point \(z\) is collinear with \(u\) and \(v\) iff \(\frac{z-u}{v-u}\) is real. Taking conjugates and using \(\bar u = 1/u\), \(\bar v = 1/v\) gives the stated equation. \(\square\)

2. Equations of the relevant lines

Let \(\zeta = e^{2\pi i/3}\). The equilateral triangle \(\Delta_B\) inscribed in \(\omega\) with vertex \(B\) has the other two vertices \(B\zeta\) and \(B\zeta^2\). The side opposite \(B\) is \(\ell_B\), the line through \(B\zeta\) and \(B\zeta^2\). Applying Lemma 1 with \(u = b\zeta\), \(v = b\zeta^2\) yields \(uv = b^2\) and \(u+v = b(\zeta+\zeta^2) = -b\). Hence

\[ \ell_B:\; z + b^2\bar{z} = -b. \quad\text{(1)} \] Analogously,

\[ \ell_C:\; z + c^2\bar{z} = -c. \quad\text{(2)} \] The point \(N\) is the midpoint of the minor arc \(BC\) (not containing \(A\)). On the unit circle the midpoint of an arc has the property that its square equals the product of the endpoints:

\[ N^2 = bc. \quad\text{(3)} \] The tangent to \(\omega\) at \(N\) is given by

\[ z + N^2\bar{z} = 2N. \] Using (3) we obtain

\[ \text{tangent at }N:\; z + bc\,\bar{z} = 2N. \quad\text{(4)} \]
3. Intersection points \(Y\) and \(Z\)

The line \(AC\) has equation (by Lemma 1)

\[ AC:\; z + ac\,\bar{z} = a + c. \quad\text{(5)} \] Intersect \(AC\) with \(\ell_B\). Subtract (5) from (1):

\[ (b^2 - ac)\,\bar{z} = -b - (a+c) = -(a+b+c). \] Set

\[ S = a+b+c,\qquad D_1 = ac - b^2. \] Then \(\bar{z} = S/D_1\). Substitute into (1) to find the coordinate \(y\):

\[ y = -b - b^2\bar{y} = -b - \frac{b^2 S}{D_1} = -\frac{b D_1 + b^2 S}{D_1}. \] Compute the numerator:

\[ b D_1 + b^2 S = b(ac - b^2) + b^2(a+b+c) = abc - b^3 + ab^2 + b^3 + b^2c = b(ac + ab + bc) = b T, \] where

\[ T = ab + bc + ca. \] Thus

\[ y = -\frac{b T}{D_1},\qquad \bar{y} = \frac{S}{D_1}. \quad\text{(6)} \] By symmetry, intersecting \(AB\) (equation \(z + ab\,\bar{z} = a+b\)) with \(\ell_C\) gives

\[ z = -\frac{c T}{D_2},\qquad \bar{z} = \frac{S}{D_2},\qquad D_2 = ab - c^2. \quad\text{(7)} \]
4. A convenient rotation

The configuration is invariant under rotations of the circle. We choose the rotation so that \(N = 1\). Then (3) yields \(bc = 1\), hence \(c = \bar{b}\). Write

\[ b = e^{i\alpha},\qquad c = e^{-i\alpha}, \] where \(\alpha = \angle A\) (by the inscribed angle theorem, the central angle subtended by \(BC\) is \(2\alpha\)). Since the triangle is acute, \(\alpha \in (0^\circ,90^\circ)\) and, by hypothesis, \(\alpha \neq 60^\circ\). Let

\[ k = \cos\alpha. \] The remaining vertex is \(A = a = e^{i\theta}\). Because \(N = 1\) lies on the minor arc \(BC\) not containing \(A\), the argument \(\theta\) satisfies \(\theta \in (\alpha,\, 2\pi-\alpha)\) (or its symmetric equivalent).

Now compute the quantities that appear in (6), (7) in this coordinate system:

\[ \begin{aligned} S &= a + b + c = a + e^{i\alpha} + e^{-i\alpha} = a + 2k, \\[2mm] T &= ab + bc + ca = a e^{i\alpha} + 1 + a e^{-i\alpha} = 1 + 2k a, \\[2mm] Q &= b^2 + bc + c^2 = e^{i2\alpha} + 1 + e^{-i2\alpha} = 2\cos 2\alpha + 1 = 4k^2 - 1, \\[2mm] D_1 &= ac - b^2 = a e^{-i\alpha} - e^{i2\alpha}, \\[2mm] D_2 &= ab - c^2 = a e^{i\alpha} - e^{-i2\alpha}, \\[2mm] \Delta &= D_1 D_2 = (a e^{-i\alpha} - e^{i2\alpha})(a e^{i\alpha} - e^{-i2\alpha}) = a^2 - 2a\cos 3\alpha + 1. \end{aligned} \]
5. A key algebraic identity

Lemma 2. With the above notation,

\[ (a + 2k)^2 = Q\,T + \Delta. \quad\text{(8)} \] Proof. Expand \(Q\,T + \Delta\):

\[ \begin{aligned} Q\,T &= (4k^2-1)(1+2k a) = (4k^2-1) + 2k(4k^2-1)a, \\[2mm] \Delta &= a^2 - 2a\cos 3\alpha + 1. \end{aligned} \] Recall \(\cos 3\alpha = 4k^3 - 3k\). Then

\[ \begin{aligned} Q\,T + \Delta &= a^2 + \bigl[2k(4k^2-1) - 2\cos 3\alpha\bigr] a + \bigl[(4k^2-1)+1\bigr] \\ &= a^2 + \bigl[8k^3 - 2k - (8k^3 - 6k)\bigr] a + 4k^2 \\ &= a^2 + 4k a + 4k^2 = (a+2k)^2. \quad\square \end{aligned} \]
6. The circumcenter \(O\) of \(\triangle AYZ\)

We claim that the point

\[ O = -\frac{a Q T}{\Delta} \quad\text{(9)} \] is the circumcenter of \(\triangle AYZ\). Let us verify that it is equidistant from \(A\), \(Y\) and \(Z\).

Distance to \(A\)

\[ O - a = -\frac{a Q T}{\Delta} - a = -a\left( \frac{Q T}{\Delta} + 1\right) = -\frac{a (Q T + \Delta)}{\Delta}. \] By Lemma 2, \(Q T + \Delta = (a+2k)^2\), so

\[ O - a = -\frac{a (a+2k)^2}{\Delta}. \quad\text{(10)} \] Hence

\[ |O - a| = \frac{|a+2k|^2}{|\Delta|}. \quad\text{(11)} \]
Distance to \(Y\)

Using (6), \(\bar{y} = S/D_1\) and \(y = -b T/D_1\). Compute

\[ O - y = -\frac{a Q T}{\Delta} + \frac{b T}{D_1} = T\left( -\frac{a Q}{\Delta} + \frac{b}{D_1}\right). \] Since \(\Delta = D_1 D_2\),

\[ -\frac{a Q}{\Delta} + \frac{b}{D_1} = \frac{-a Q}{D_1 D_2} + \frac{b D_2}{D_1 D_2} = \frac{-a Q + b D_2}{\Delta}. \] Thus

\[ O - y = T\,\frac{-a Q + b D_2}{\Delta}. \quad\text{(12)} \] Now compute \(b D_2 - a Q\):

\[ \begin{aligned} b D_2 &= e^{i\alpha}(a e^{i\alpha} - e^{-i2\alpha}) = a e^{i2\alpha} - e^{-i\alpha}, \\ a Q &= a(e^{i2\alpha} + 1 + e^{-i2\alpha}) = a e^{i2\alpha} + a + a e^{-i2\alpha}, \\ \therefore\; b D_2 - a Q &= - e^{-i\alpha} - a - a e^{-i2\alpha}. \end{aligned} \] On the other hand,

\[ - e^{-i\alpha} T = -e^{-i\alpha}(1+2k a) = -e^{-i\alpha} - 2k a e^{-i\alpha} = -e^{-i\alpha} - a(e^{i\alpha}+e^{-i\alpha})e^{-i\alpha} = -e^{-i\alpha} - a(1 + e^{-i2\alpha}) = -e^{-i\alpha} - a - a e^{-i2\alpha}. \] Therefore

\[ b D_2 - a Q = - e^{-i\alpha} T, \] and consequently

\[ |b D_2 - a Q| = |T|. \] From (12) we obtain

\[ |O - y| = \frac{|T|^2}{|\Delta|}. \quad\text{(13)} \]
Distance to \(Z\)

A completely symmetric computation (interchanging \(b\) with \(c\), \(D_1\) with \(D_2\)) gives

\[ |O - z| = \frac{|T|^2}{|\Delta|}. \quad\text{(14)} \]
Equality of the distances

Now note that

\[ |T|^2 = (1+2k a)(1+2k \bar a) = 1 + 2k(a+\bar a) + 4k^2 = 1 + 2k t + 4k^2, \qquad t = a+\bar a = 2\cos\theta. \] But also

\[ |a+2k|^2 = (a+2k)(\bar a+2k) = 1 + 2k(a+\bar a) + 4k^2 = |T|^2. \] Thus

\[ |O - a| = \frac{|a+2k|^2}{|\Delta|},\qquad |O - y| = \frac{|T|^2}{|\Delta|} = \frac{|a+2k|^2}{|\Delta|},\qquad |O - z| = \frac{|a+2k|^2}{|\Delta|}. \] Hence \(O\) is indeed the circumcenter of \(\triangle AYZ\), and the circumradius is

\[ R = \frac{|a+2k|^2}{|\Delta|}. \quad\text{(15)} \]
7. Cartesian description of triangle \(\mathcal{R}\)

Now we work in the rotated coordinate system where \(N=1\), \(b=e^{i\alpha}\), \(c=e^{-i\alpha}\). Write a complex number \(z = x + iy\).

Equation of \(\ell_B\)

From (1): \(z + b^2\bar{z} = -b\). Substituting \(b = \cos\alpha + i\sin\alpha\), \(b^2 = \cos2\alpha + i\sin2\alpha\), we separate real and imaginary parts:

\[ \begin{cases} x(1+\cos2\alpha) + y\sin2\alpha = -\cos\alpha, \\[2mm] x\sin2\alpha + y(1-\cos2\alpha) = -\sin\alpha. \end{cases} \] Using the identities

\[ 1+\cos2\alpha = 2\cos^2\alpha,\quad \sin2\alpha = 2\sin\alpha\cos\alpha,\quad 1-\cos2\alpha = 2\sin^2\alpha, \] and dividing the first equation by \(2\cos\alpha\) (since \(\cos\alpha>0\)) and the second by \(2\sin\alpha\) (since \(\sin\alpha>0\)), both reduce to

\[ x\cos\alpha + y\sin\alpha = -\frac12. \quad\text{(16)} \]
Equation of \(\ell_C\)

Similarly, for \(\ell_C\) given by \(z + c^2\bar{z} = -c\) with \(c = \cos\alpha - i\sin\alpha\), \(c^2 = \cos2\alpha - i\sin2\alpha\). Separating real and imaginary parts yields

\[ \begin{cases} x(1+\cos2\alpha) - y\sin2\alpha = -\cos\alpha, \\[2mm] - x\sin2\alpha + y(1-\cos2\alpha) = \sin\alpha. \end{cases} \] Again, dividing appropriately we obtain

\[ x\cos\alpha - y\sin\alpha = -\frac12. \quad\text{(17)} \]
Equation of the tangent at \(N=1\)

Since \(N=1\) lies on the unit circle, its tangent is the line \(z + \bar{z} = 2\), i.e.,

\[ x = 1. \quad\text{(18)} \] Thus \(\mathcal{R}\) is the triangle bounded by the three lines (16), (17) and (18).

8. Vertices and interior of \(\mathcal{R}\)

The three vertices are the pairwise intersections of the lines.

\(P = \ell_B \cap \ell_C\): solving (16) and (17) gives

\[ 2x\cos\alpha = -1 \;\Longrightarrow\; x = -\frac{1}{2\cos\alpha},\qquad y = 0. \]

\(Q' = \ell_C \cap \text{tangent }x=1\): plug \(x=1\) into (17):

\[ \cos\alpha - y\sin\alpha = -\frac12 \;\Longrightarrow\; y = \frac{\cos\alpha + \frac12}{\sin\alpha}. \]

\(R' = \ell_B \cap \text{tangent }x=1\): plug \(x=1\) into (16):

\[ \cos\alpha + y\sin\alpha = -\frac12 \;\Longrightarrow\; y = -\frac{\cos\alpha + \frac12}{\sin\alpha}. \] Hence the triangle \(\mathcal{R}\) has vertices

\[ P\left(-\frac{1}{2\cos\alpha},0\right),\quad Q'\left(1,\frac{\cos\alpha+\frac12}{\sin\alpha}\right),\quad R'\left(1,-\frac{\cos\alpha+\frac12}{\sin\alpha}\right). \] To determine which side of each line constitutes the interior, we test the vertex opposite that line.

For line \(\ell_B\), the opposite vertex is \(Q'\). Compute the left-hand side of (16) at \(Q'\):

\[ x\cos\alpha + y\sin\alpha = 1\cdot\cos\alpha + \left(\frac{\cos\alpha+\frac12}{\sin\alpha}\right)\sin\alpha = \cos\alpha + \cos\alpha + \frac12 = 2\cos\alpha + \frac12 > -\frac12. \] Therefore the interior of \(\mathcal{R}\) satisfies

\[ x\cos\alpha + y\sin\alpha > -\frac12. \quad\text{(19a)} \]

For line \(\ell_C\), opposite vertex is \(R'\). At \(R'\):

\[ x\cos\alpha - y\sin\alpha = 1\cdot\cos\alpha - \left(-\frac{\cos\alpha+\frac12}{\sin\alpha}\right)\sin\alpha = \cos\alpha + \cos\alpha + \frac12 = 2\cos\alpha + \frac12 > -\frac12, \] so the interior satisfies

\[ x\cos\alpha - y\sin\alpha > -\frac12. \quad\text{(19b)} \]

For the tangent \(x=1\), opposite vertex is \(P\) with \(x_P = -\frac{1}{2\cos\alpha} < 1\), thus the interior satisfies

\[ x < 1. \quad\text{(19c)} \] Therefore \(\mathcal{R} = \bigl\{(x,y) : x\cos\alpha + y\sin\alpha > -\frac12,\; x\cos\alpha - y\sin\alpha > -\frac12,\; x < 1 \bigr\}\).

9. Incenter \(I\) and inradius \(r\) of \(\mathcal{R}\)

The triangle is symmetric with respect to the \(x\)-axis (the lines \(\ell_B\) and \(\ell_C\) are symmetric, the tangent is vertical). Hence the incenter lies on the \(x\)-axis: \(I = (p,0)\).

For a point \((x,0)\) inside \(\mathcal{R}\) (so satisfying the inequalities), the distances to the three lines are:

To \(\ell_B\): the line is \(x\cos\alpha + y\sin\alpha + \frac12 = 0\); distance \(= \dfrac{x\cos\alpha + \frac12}{\sqrt{\cos^2\alpha+\sin^2\alpha}} = x\cos\alpha + \frac12\) (since the interior gives \(x\cos\alpha + \frac12 > 0\)).

To \(\ell_C\): similarly, distance \(= x\cos\alpha + \frac12\) (because \(x\cos\alpha - 0 + \frac12 = x\cos\alpha + \frac12 > 0\)).

To the tangent \(x=1\): distance \(= 1 - x\) (since \(x<1\)).

Setting these equal gives

\[ x\cos\alpha + \frac12 = 1 - x \quad\Longrightarrow\quad x(\cos\alpha + 1) = \frac12 \quad\Longrightarrow\quad x = \frac{1}{2(1+\cos\alpha)}. \] Thus the incenter is

\[ I = \left( \frac{1}{2(1+\cos\alpha)},\, 0 \right) = (p,\,0), \qquad p = \frac{1}{2(1+k)}. \quad\text{(20)} \] The common distance is the inradius:

\[ r = 1 - p = 1 - \frac{1}{2(1+k)} = \frac{2(1+k)-1}{2(1+k)} = \frac{1+2k}{2(1+k)}. \quad\text{(21)} \]
10. Distance \(OI\)

We have the circumcenter

\[ O = -\frac{a Q T}{\Delta}, \] and the incenter

\[ I = p = \frac{1}{2(1+\cos\alpha)} = \frac{1}{D_0}, \] where we denote

\[ D_0 = 2(1+\cos\alpha) = 2(1+k). \] Then

\[ O - I = -\frac{a Q T}{\Delta} - p = -\frac{a Q T + p \Delta}{\Delta}. \] Set \(U = a Q T + p \Delta\); then \(OI = |U|/|\Delta|\).

Now substitute the expressions for \(a Q T\), \(p\) and \(\Delta\). Write

\[ a Q T = a(4k^2-1)(1+2k a) = (4k^2-1)a + 2k(4k^2-1)a^2. \] Also \(p = 1/D_0\) and \(\Delta = a^2 - 2a\cos3\alpha + 1\).

Thus

\[ U = \bigl[2k(4k^2-1) + p\bigr] a^2 + \bigl[(4k^2-1) - 2p\cos3\alpha\bigr] a + p. \quad\text{(22)} \] Compute the coefficients with denominator \(D_0 = 2(1+k)\).

\textbf{Coefficient of

\(a^2\):} \[ A_2 = 2k(4k^2-1) + \frac{1}{D_0}. \] Write as a single fraction:

\[ A_2 = \frac{(2k(4k^2-1)) D_0 + 1}{D_0}. \] Compute \((2k(4k^2-1)) D_0 = (8k^3-2k) \cdot 2(1+k) = 16k^4 + 16k^3 - 4k^2 - 4k.\) Adding 1 gives

\[ 16k^4 + 16k^3 - 4k^2 - 4k + 1. \] Notice that

\[ X = 4k^2 + 2k - 1, \] then

\[ X^2 = (4k^2+2k-1)^2 = 16k^4 + 16k^3 - 4k^2 - 4k + 1. \] Hence

\[ A_2 = \frac{X^2}{D_0}. \quad\text{(23)} \]

\textbf{Coefficient of

\(a\):} \[ A_1 = (4k^2-1) - 2p\cos3\alpha = (4k^2-1) - \frac{2\cos3\alpha}{D_0}. \] Write as

\[ A_1 = \frac{(4k^2-1)D_0 - 2\cos3\alpha}{D_0}. \] Compute \((4k^2-1)D_0 = (4k^2-1)\cdot 2(1+k) = 8k^3 + 8k^2 - 2k - 2.\) And \(2\cos3\alpha = 2(4k^3-3k) = 8k^3 - 6k.\) Subtract:

\[ (8k^3+8k^2-2k-2) - (8k^3-6k) = 8k^2 + 4k - 2 = 2(4k^2+2k-1) = 2X. \] Therefore

\[ A_1 = \frac{2X}{D_0}. \quad\text{(24)} \]

\textbf{Constant term:

\(p = \dfrac{1}{D_0}\).} Substituting (23) and (24) into (22) yields

\[ U = \frac{X^2}{D_0} a^2 + \frac{2X}{D_0} a + \frac{1}{D_0} = \frac{(X a + 1)^2}{D_0}. \quad\text{(25)} \] Consequently,

\[ OI = \frac{|U|}{|\Delta|} = \frac{|X a + 1|^2}{D_0\, |\Delta|}. \quad\text{(26)} \]
11. Relating \(OI\) to \(R\) and \(r\)

Recall the circumradius of \(\triangle AYZ\):

\[ R = \frac{|a+2k|^2}{|\Delta|}. \quad\text{(27)} \] The inradius of \(\mathcal{R}\) is

\[ r = \frac{1+2k}{D_0}. \quad\text{(28)} \] Now compute

\[ \frac{|X a + 1|^2}{D_0} = |a+2k|^2 + L, \] where

\[ L = \frac{|X a + 1|^2}{D_0} - |a+2k|^2. \] From (26),

\[ OI = \frac{|a+2k|^2 + L}{|\Delta|} = R + \frac{L}{|\Delta|}. \quad\text{(29)} \] Thus if we can show \(L = \pm r\,|\Delta|\), we will have \(OI = R \pm r\), which implies tangency.

Let \(t = a + \bar a = 2\cos\theta\). Then

\[ |X a + 1|^2 = (X a + 1)(X \bar a + 1) = X^2 + X t + 1. \] Also

\[ |a+2k|^2 = (a+2k)(\bar a+2k) = 1 + 2k t + 4k^2. \] Hence

\[ L = \frac{X^2 + X t + 1}{D_0} - (1 + 2k t + 4k^2). \] Multiply by \(D_0\):

\[ D_0 L = X^2 + X t + 1 - D_0(1 + 2k t + 4k^2). \] Now \(D_0(1 + 2k t + 4k^2) = 2(1+k) + 4k(1+k) t + 8k^2(1+k).\)

Thus

\[ D_0 L = \underbrace{X^2 + 1 - 2(1+k) - 8k^2(1+k)}_{\text{constant}} + \underbrace{(X - 4k(1+k))}_{\text{coefficient of }t} t. \] Compute the coefficient of \(t\):

\[ X - 4k(1+k) = (4k^2+2k-1) - (4k^2+4k) = -2k-1 = -(2k+1). \] For the constant term, substitute \(X^2 = 16k^4+16k^3-4k^2-4k+1\):

\[ \begin{aligned} X^2 + 1 - 2(1+k) - 8k^2(1+k) &= (16k^4+16k^3-4k^2-4k+1) + 1 - 2 - 2k - 8k^2 - 8k^3 \\ &= 16k^4 + (16k^3-8k^3) + (-4k^2-8k^2) + (-4k-2k) + (1+1-2) \\ &= 16k^4 + 8k^3 - 12k^2 - 6k. \end{aligned} \] Factor this expression:

\[ 16k^4 + 8k^3 - 12k^2 - 6k = 2k(8k^3+4k^2-6k-3). \] Now note that \(8k^3+4k^2-6k-3 = (4k^2-3)(2k+1)\), because

\[ (4k^2-3)(2k+1) = 8k^3+4k^2-6k-3. \] Thus

\[ \text{constant} = 2k (4k^2-3)(2k+1). \] But \(4k^2-3 = \frac{\cos3\alpha}{k}\) (since \(\cos3\alpha = 4k^3-3k = k(4k^2-3)\)). Hence

\[ \text{constant} = 2k \cdot \frac{\cos3\alpha}{k} \cdot (2k+1) = 2(2k+1)\cos3\alpha. \] Therefore

\[ D_0 L = 2(2k+1)\cos3\alpha + (-(2k+1)) t = (2k+1)(2\cos3\alpha - t). \quad\text{(30)} \] Now recall that \(r = (2k+1)/D_0\). So

\[ (2k+1) = r D_0. \] Substitute into (30):

\[ D_0 L = r D_0 (2\cos3\alpha - t) \quad\Longrightarrow\quad L = r (2\cos3\alpha - t). \quad\text{(31)} \]
Connection with \(\Delta\)

Compute \(\Delta\) in terms of \(t\):

\[ \Delta = a^2 - 2a\cos3\alpha + 1 = a(a + \bar a - 2\cos3\alpha) = a(t - 2\cos3\alpha). \] Since \(|a|=1\), we have

\[ |\Delta| = |t - 2\cos3\alpha| = |2\cos3\alpha - t|. \] Hence

\[ 2\cos3\alpha - t = \varepsilon\, |\Delta|, \] where \(\varepsilon = \pm 1\) depending on the sign of \(t - 2\cos3\alpha\).

Consequently,

\[ L = \varepsilon\, r\, |\Delta|. \quad\text{(32)} \]
Final step

Insert (32) into (29):

\[ OI = R + \frac{\varepsilon\, r\, |\Delta|}{|\Delta|} = R + \varepsilon r = R \pm r. \] Thus the distance between the centers \(O\) and \(I\) equals either the sum or the absolute difference of the radii \(R\) and \(r\). Therefore the circumcircle of \(\triangle AYZ\) and the incircle of \(\triangle\mathcal{R}\) are tangent. \(\square\)

12. Remarks on non-vanishing denominators

\(D_1 = 0\) would imply \(ac = b^2\). In our rotated frame, this gives \(a = e^{i3\alpha}\), which forces \(AB = BC\) (since then \(|a-b| = |e^{i3\alpha}-e^{i\alpha}| = 2\sin\alpha\) and \(|b-c| = |e^{i\alpha}-e^{-i\alpha}| = 2\sin\alpha\)), contradicting the scalene hypothesis. Hence \(D_1 \neq 0\); similarly \(D_2 \neq 0\), so \(\Delta \neq 0\).

\(a+2k = 0\) would give \(a = -2k\) real; with \(|a|=1\) we get \(2k=1\) i.e. \(\cos\alpha = 1/2\), \(\alpha = 60^\circ\), which is excluded. Thus \(a+2k \neq 0\), ensuring \(R > 0\).

\(\cos\alpha > 0\) because \(\alpha\) is acute.

All algebraic manipulations are therefore justified, and the proof is complete.

Question

A positive integer $n$ is called solitary if, for any nonnegative integers $a$ and $b$ such that $a + b = n$, either $a$ or $b$ contains the digit \(1\). Determine, with proof, the number of solitary integers less than $10^{2026}$.

Answer
Expert verdict: 7/7
1. Equivalent formulation

Let

\[ S = \{ x \in \mathbb{N}_0 \mid \text{the decimal representation of } x \text{ contains no digit } 1\}. \] (Note that \(0\in S\) because its representation "0" has no digit \(1\).)

If \(n = a+b\) with \(a,b\in S\), then the pair \((a,b)\) shows that \(n\) is not solitary (both \(a\) and \(b\) lack a digit \(1\)). Conversely, if for every representation \(n = a+b\) at least one of \(a,b\) contains a digit \(1\), then certainly no representation with both in \(S\) exists. Hence

\[ n \text{ is solitary } \Longleftrightarrow \; n \notin S+S, \qquad\text{where } S+S = \{ x+y \mid x,y\in S\}. \] We need to count the positive integers \(n < 10^{2026}\) that are not in \(S+S\).

Set

\[ N = 2026. \] We will first count how many numbers \(0 \le n < 10^N\) belong to \(S+S\); then subtract to get the number of positive solitary integers.

2. Digit-wise analysis and carries

Every integer \(m\) with \(0 \le m < 10^N\) can be written uniquely as

\[ m = \sum_{i=0}^{N-1} d_i 10^i, \] where each digit \(d_i\) is in \(\{0,1,\dots,9\}\). To have a uniform treatment, we pad the representation with leading zeros so that every such \(m\) uses exactly \(N\) digits.

If \(a,b\in S\), then each of their digits belongs to

\[ D = \{0,2,3,4,5,6,7,8,9\}\qquad(\text{all digits except }1). \] Write \(a = \sum a_i 10^i\), \(b = \sum b_i 10^i\) with \(a_i,b_i\in D\). The addition \(a+b = n\) proceeds digit by digit with carries \(c_0,c_1,\dots,c_N\):

\[ a_i + b_i + c_i = n_i + 10\,c_{i+1},\qquad c_0 = 0, \] where each \(c_i\) is either \(0\) or \(1\) (since the maximum sum is \(9+9+1 = 19\)). Because \(n < 10^N\), the final carry must be \(c_N = 0\).

3. Possible sums of two digits from \(D\)

Define

\[ \Sigma = \{ a_i+b_i \mid a_i,b_i \in D \}. \] Since the only digit missing from \(D\) is \(1\), the sums that can be obtained are

\[ \Sigma = \{0\} \cup \{2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18\}. \] (Indeed, \(1\) cannot be expressed as a sum of two digits from \(D\); all other integers from \(0\) to \(18\) can.)

4. Transition sets \(T(s,d)\)

For a fixed carryin \(s \in \{0,1\}\) and a target digit \(d \in \{0,\dots,9\}\), let

\[ T(s,d) = \bigl\{ t \in \{0,1\} \;\big|\; \exists a_i,b_i\in D \text{ with } a_i+b_i+s = d+10t \bigr\}. \] Using \(\Sigma\), we can compute \(T(s,d)\).

Case \(s = 0\)

Here the total sum before splitting is simply \(s_0\) with \(s_0 \in \Sigma\).

If \(s_0 \le 9\), we may take \(t = 0\) and the digit is \(s_0\).

If \(s_0 \ge 10\), we may take \(t = 1\) and the digit is \(s_0-10\).

Thus:

\[ \begin{array}{c|l} d & T(0,d) \\ \hline 0 & \{0,1\} \quad (\text{totals }0\text{ and }10) \\ 1 & \{1\} \quad (\text{total }11) \\ 2 & \{0,1\} \quad (\text{totals }2\text{ and }12) \\ 3 & \{0,1\} \quad (\text{totals }3\text{ and }13) \\ 4 & \{0,1\} \quad (\text{totals }4\text{ and }14) \\ 5 & \{0,1\} \quad (\text{totals }5\text{ and }15) \\ 6 & \{0,1\} \quad (\text{totals }6\text{ and }16) \\ 7 & \{0,1\} \quad (\text{totals }7\text{ and }17) \\ 8 & \{0,1\} \quad (\text{totals }8\text{ and }18) \\ 9 & \{0\} \quad (\text{total }9) \\ \end{array} \] In words:

\(d = 9\) gives only \(t = 0\).

\(d = 1\) gives only \(t = 1\).

The other eight digits (\(0,2,3,4,5,6,7,8\)) allow both \(t = 0\) and \(t = 1\).

Case \(s = 1\)

Now the total sum is \(s_0 + 1\) with \(s_0 \in \Sigma\). Hence the attainable totals are

\[ \Sigma + 1 = \{1\} \cup \{3,4,5,\dots,19\}, \] i.e., all integers from \(1\) to \(19\) except \(2\).

Proceeding analogously:

\[ \begin{array}{c|l} d & T(1,d) \\ \hline 0 & \{1\} \quad (\text{total }19) \\ 1 & \{0,1\} \quad (\text{totals }1\text{ and }11) \\ 2 & \{1\} \quad (\text{total }12) \\ 3 & \{0,1\} \quad (\text{totals }3\text{ and }13) \\ 4 & \{0,1\} \quad (\text{totals }4\text{ and }14) \\ 5 & \{0,1\} \quad (\text{totals }5\text{ and }15) \\ 6 & \{0,1\} \quad (\text{totals }6\text{ and }16) \\ 7 & \{0,1\} \quad (\text{totals }7\text{ and }17) \\ 8 & \{0,1\} \quad (\text{totals }8\text{ and }18) \\ 9 & \{0,1\} \quad (\text{totals }9\text{ and }19) \\ \end{array} \] Thus:

\(d = 0\) and \(d = 2\) give only \(t = 1\).

The other eight digits (\(1,3,4,5,6,7,8,9\)) allow both \(t = 0\) and \(t = 1\).

5. State of the possible carries

For a given \(n\) with digits \(n_0,n_1,\dots,n_{N-1}\) (least significant first), consider all sequences of carries \(c_0,c_1,\dots,c_N\) that can arise from some choices of \(a_i,b_i\in D\). Define

\[ R_i = \{\, c_i \mid \text{there exist } a_j,b_j\in D\ (j<i)\ \text{such that the carry after processing digits }0,\dots,i-1\text{ is }c_i\,\}. \] By definition, \(R_0 = \{0\}\). For \(i \ge 0\),

\[ R_{i+1} = \bigcup_{s \in R_i} T(s, n_i). \quad\text{(1)} \] Each \(T(s,d)\) is a subset of \(\{0,1\}\), and a simple check shows it is never empty. Hence every \(R_i\) is a non-empty subset of \(\{0,1\}\). Consequently, \(R_i\) can only be one of three types:

\(A_i\): \(R_i = \{0\}\) (only zero carry possible),

\(B_i\): \(R_i = \{1\}\) (only one carry possible),

\(C_i\): \(R_i = \{0,1\}\) (both carries possible).

Let

\[ \begin{aligned} A_i &= \#\{\, n \in [0,10^i) \mid R_i = \{0\} \,\}, \\ B_i &= \#\{\, n \in [0,10^i) \mid R_i = \{1\} \,\}, \\ C_i &= \#\{\, n \in [0,10^i) \mid R_i = \{0,1\} \,\}. \end{aligned} \]
6. Transition counts

We now determine, given the current state \(R_i\), for which next digits \(d = n_i\) we obtain each possible next state \(R_{i+1}\).

\textbf{If

\(R_i = \{0\}\): then \(R_{i+1} = T(0,d)\). From the table for \(s=0\):}

\(d = 9\) gives \(\{0\}\);

\(d = 1\) gives \(\{1\}\);

the other eight digits (\(0,2,3,4,5,6,7,8\)) give \(\{0,1\}\).

Hence:

1 digit yields state \(\{0\}\),

1 digit yields state \(\{1\}\),

8 digits yield state \(\{0,1\}\).

\textbf{If

\(R_i = \{1\}\): \(R_{i+1} = T(1,d)\). From the table for \(s=1\):}

\(d = 0\) and \(d = 2\) give \(\{1\}\);

the other eight digits (\(1,3,4,5,6,7,8,9\)) give \(\{0,1\}\).

Hence:

2 digits yield state \(\{1\}\),

8 digits yield state \(\{0,1\}\).

\textbf{If

\(R_i = \{0,1\}\): \(R_{i+1} = T(0,d) \cup T(1,d)\). Checking each digit individually shows that this union is always \(\{0,1\}\). Indeed:}

\(d=0\): \(T(0,0)=\{0,1\}\), \(T(1,0)=\{1\}\) $\to$ union = \(\{0,1\}\);

\(d=1\): \(T(0,1)=\{1\}\), \(T(1,1)=\{0,1\}\) $\to$ union = \(\{0,1\}\);

\(d=2\): \(T(0,2)=\{0,1\}\), \(T(1,2)=\{1\}\) $\to$ union = \(\{0,1\}\);

\(d=3,\dots,8\): both sets contain \(0\) and \(1\);

\(d=9\): \(T(0,9)=\{0\}\), \(T(1,9)=\{0,1\}\) $\to$ union = \(\{0,1\}\).

Therefore, all 10 digits keep the state as \(\{0,1\}\).

Summarising the transitions in a matrix:

\[ \begin{array}{c|ccc} \text{from}\backslash\text{to} & \{0\} & \{1\} & \{0,1\} \\ \hline \{0\} & 1 & 1 & 8 \\ \{1\} & 0 & 2 & 8 \\ \{0,1\} & 0 & 0 & 10 \end{array} \]
7. Recurrence relations

A number with \(i+1\) digits (i.e., an integer in \([0,10^{i+1})\)) is obtained by taking a number \(m\) in \([0,10^i)\) (which yields a certain state) and appending a new most significant digit \(d\) (which becomes \(n_i\)). The number of ways to reach each state for length \(i+1\) is therefore:

\[ \begin{aligned} A_{i+1} &= 1\cdot A_i + 0\cdot B_i + 0\cdot C_i = A_i, \\[4pt] B_{i+1} &= 1\cdot A_i + 2\cdot B_i + 0\cdot C_i = A_i + 2B_i, \\[4pt] C_{i+1} &= 8\cdot A_i + 8\cdot B_i + 10\cdot C_i. \end{aligned} \quad\text{(2)} \] Initial conditions: For \(i = 0\) we have processed no digits. The only possible "number" is \(0\), and the only possible carry is \(c_0 = 0\). Hence

\[ A_0 = 1,\qquad B_0 = 0,\qquad C_0 = 0. \]
8. Solving the recurrences
8.1. \(A_i\)

From \(A_{i+1} = A_i\) and \(A_0 = 1\), we immediately obtain

\[ \boxed{A_i = 1 \quad\text{for all } i\ge 0}. \]
8.2. \(B_i\)

Substituting \(A_i = 1\) into the recurrence for \(B_i\):

\[ B_{i+1} = 1 + 2B_i,\qquad B_0 = 0. \] We claim

\[ \boxed{B_i = 2^i - 1 \quad\text{for all } i\ge 0}. \] Proof by induction.

\(i = 0\): \(2^0 - 1 = 0\), true.

Assume \(B_i = 2^i - 1\). Then

\[ B_{i+1} = 1 + 2(2^i - 1) = 1 + 2^{i+1} - 2 = 2^{i+1} - 1, \] which completes the induction.

8.3. \(C_i\)

Now substitute \(A_i = 1\) and \(B_i = 2^i - 1\) into the recurrence for \(C_{i+1}\):

\[ \begin{aligned} C_{i+1} &= 8\cdot 1 + 8\cdot (2^i - 1) + 10\,C_i \\ &= 8 + 8\cdot 2^i - 8 + 10\,C_i \\ &= 8\cdot 2^i + 10\,C_i. \end{aligned} \] With \(C_0 = 0\). We claim

\[ \boxed{C_i = 10^i - 2^i \quad\text{for all } i\ge 0}. \] Proof by induction.

\(i = 0\): \(10^0 - 2^0 = 1 - 1 = 0\), true.

Assume \(C_i = 10^i - 2^i\). Then

\[ \begin{aligned} C_{i+1} &= 8\cdot 2^i + 10(10^i - 2^i) \\ &= 8\cdot 2^i + 10^{i+1} - 10\cdot 2^i \\ &= 10^{i+1} - 2\cdot 2^i \\ &= 10^{i+1} - 2^{i+1}, \end{aligned} \] which establishes the claim.

9. Representable numbers

After processing all \(N\) digits, a number \(n \in [0,10^N)\) can be written as \(a+b\) with \(a,b\in S\) iff there exists a carry sequence with \(c_N = 0\). In terms of the sets, this is equivalent to \(0 \in R_N\).

The possible values of \(R_N\) are \(\{0\}\), \(\{1\}\), or \(\{0,1\}\). Among these, \(0 \in R_N\) exactly when \(R_N = \{0\}\) or \(R_N = \{0,1\}\). Therefore

\[ |S+S \cap [0,10^N)| = A_N + C_N. \] Plugging in the formulas:

\[ |S+S \cap [0,10^N)| = 1 + (10^N - 2^N) = 10^N - 2^N + 1. \] This count includes \(n = 0\) (since \(0 = 0+0\) and \(0 \in S\)).

10. Positive solitary numbers

We are interested in positive integers \(n < 10^N\) that are solitary, i.e., \(n > 0\) and \(n \notin S+S\).

Total positive integers less than \(10^N\) are

\[ 10^N - 1. \] The number of positive integers that belong to \(S+S\) (hence are not solitary) is

\[ |(S+S) \setminus \{0\}| = (10^N - 2^N + 1) - 1 = 10^N - 2^N. \] Thus the number of positive solitary integers is

\[ (10^N - 1) - (10^N - 2^N) = 2^N - 1. \]
11. Final answer

For \(N = 2026\), we obtain

\[ \boxed{2^{2026} - 1}. \]
12. Small-case verification (optional)

\(N = 1\): numbers \(1,\dots,9\). The formula gives \(2^1 - 1 = 1\) solitary number. Indeed, \(n = 1\) is solitary because every pair \((a,b)\) with \(a+b=1\) has either \(a=0,b=1\) or \(a=1,b=0\); in both cases the number \(1\) contains a digit \(1\). All other \(n\) (e.g., \(2\)) have a representation with both numbers lacking digit \(1\) (e.g., \(2 = 2 + 0\)), so they are not solitary.

\(N = 2\): numbers \(1,\dots,99\). The formula gives \(2^2 - 1 = 3\) solitary numbers. One can check that they are \(1, 19, 21\). This matches the known pattern.

The solution is complete.

Question

Let $ABC$ be a triangle. Points $D$, $E$, and $F$ lie on sides $BC$, $CA$, and $AB$, respectively, such that \[ \angle AFE = \angle BDF = \angle CED. \] Let $O_A$, $O_B$, and $O_C$ be the circumcenters of triangles $AFE$, $BDF$, and $CED$, respectively. Let $M$, $N$, and $O$ be the circumcenters of triangles $ABC$, $DEF$, and $O_A O_B O_C$, respectively. Prove that $OM = ON$.

Answer
Expert verdict: 7/7

We are given triangle \(ABC\) with points \(D\in BC\), \(E\in CA\), \(F\in AB\) such that

\[ \angle AFE = \angle BDF = \angle CED =: \theta. \] We shall use complex numbers. Without loss of generality we may place the triangle in the complex plane and denote by \(a,b,c\) the complex numbers corresponding to \(A,B,C\).

1. Angle Chase

Denote the angles of \(\triangle ABC\) by \(\alpha = \angle BAC\), \(\beta = \angle ABC\), \(\gamma = \angle ACB\).

At vertex \(F\)

Points \(A,F,B\) are collinear, so \(\angle AFB = 180^\circ\). The three angles around \(F\) on the side of \(AB\) that contains the triangle are \(\angle AFE\), \(\angle EFD\), \(\angle DFB\) and they sum to \(180^\circ\):

\[ \angle AFE + \angle EFD + \angle DFB = 180^\circ. \quad\text{(1)} \] In \(\triangle BDF\) we have \(\angle BDF = \theta\) and \(\angle DBF = \beta\) (since \(D\) lies on \(BC\) and \(F\) on \(AB\)). Hence

\[ \angle BFD = 180^\circ - \theta - \beta, \] so \(\angle DFB = 180^\circ - \theta - \beta\).

Inserting \(\angle AFE = \theta\) into (1) gives

\[ \theta + \angle EFD + (180^\circ - \theta - \beta) = 180^\circ \quad\Longrightarrow\quad \angle EFD = \beta. \] Thus

\[ \angle DFE = \beta. \quad\text{(2)} \]
At vertex \(D\)

Points \(B,D,C\) are collinear, so \(\angle BDC = 180^\circ\). The angles at \(D\) are \(\angle BDF\), \(\angle FDE\), \(\angle EDC\) and they sum to \(180^\circ\):

\[ \angle BDF + \angle FDE + \angle EDC = 180^\circ. \quad\text{(3)} \] Given \(\angle BDF = \theta\).

In \(\triangle CED\), \(\angle CED = \theta\) and \(\angle ECD = \gamma\), so

\[ \angle CDE = 180^\circ - \theta - \gamma, \] i.e., \(\angle EDC = 180^\circ - \theta - \gamma\).

Substituting into (3):

\[ \theta + \angle FDE + (180^\circ - \theta - \gamma) = 180^\circ \quad\Longrightarrow\quad \angle FDE = \gamma. \] Thus

\[ \angle EDF = \gamma. \quad\text{(4)} \]
At vertex \(E\)

Points \(C,E,A\) are collinear, so \(\angle CEA = 180^\circ\). The angles at \(E\) are \(\angle CED\), \(\angle DEF\), \(\angle FEA\) and they sum to \(180^\circ\):

\[ \angle CED + \angle DEF + \angle FEA = 180^\circ. \quad\text{(5)} \] Given \(\angle CED = \theta\).

In \(\triangle AFE\), \(\angle AFE = \theta\) and \(\angle FAE = \alpha\), so

\[ \angle AEF = 180^\circ - \theta - \alpha, \] i.e., \(\angle FEA = 180^\circ - \theta - \alpha\).

Substituting into (5):

\[ \theta + \angle DEF + (180^\circ - \theta - \alpha) = 180^\circ \quad\Longrightarrow\quad \angle DEF = \alpha. \] Thus

\[ \angle DEF = \alpha. \quad\text{(6)} \] From (2), (4), (6) we obtain

\[ \angle DFE = \beta,\quad \angle EDF = \gamma,\quad \angle DEF = \alpha. \] Therefore \(\triangle DEF\) has angles \(\alpha,\beta,\gamma\); it is similar to \(\triangle ABC\). The vertex correspondence is

\[ E \longleftrightarrow A,\qquad F \longleftrightarrow B,\qquad D \longleftrightarrow C. \quad\text{(7)} \]
2. Complex Representation of the Similarity

The similarity (7) may be either orientation-preserving (direct) or orientation-reversing (opposite). The statement \(OM = ON\) involves only distances, which are invariant under reflection. Hence we may reflect the whole configuration if necessary and assume that the similarity is direct. Consequently there exist a non-zero complex number \(k\) and a complex number \(t\) such that

\[ e = k a + t,\qquad f = k b + t,\qquad d = k c + t. \quad\text{(8)} \] (If \(k=0\), then \(e=f=t\), making \(\triangle AFE\) degenerate, contrary to the existence of its circumcenter \(O_A\).)

3. Eliminating the Translation

Assume for contradiction that \(k = 1\). Then (8) becomes

\[ e = a + t,\quad f = b + t,\quad d = c + t. \] Because \(F\) lies on \(AB\), the points \(A\), \(F\), \(B\) are collinear; hence

\[ \frac{f - a}{b - a} = \frac{b + t - a}{b - a} = 1 + \frac{t}{b-a} \in \mathbb{R}. \] Similarly, \(D\) lies on \(BC\), so

\[ \frac{d - b}{c - b} = \frac{c + t - b}{c - b} = 1 + \frac{t}{c-b} \in \mathbb{R}, \] thus \(\frac{t}{b-a} \in \mathbb{R}\) and \(\frac{t}{c-b} \in \mathbb{R}\).

The vectors \(b-a\) and \(c-b\) are not parallel (they are sides of a non-degenerate triangle), so the only complex number that is a real multiple of both is \(0\). Hence \(t = 0\), which gives \(e = a\), \(f = b\), \(d = c\). Then \(\triangle AFE\) degenerates to the segment \(AF\), contradicting the existence of \(O_A\). Therefore \(k \neq 1\).

Consider the fixed point of the spiral similarity \(z \mapsto kz + t\) (when \(k \neq 1\)):

\[ X = \frac{t}{1 - k}. \] Translate the plane so that \(X\) becomes the origin. (Translation is an isometry, so all distances and circumcenters are preserved up to the same translation; we keep the same letters for the new coordinates.) After this translation we have

\[ e = k a,\qquad f = k b,\qquad d = k c. \quad\text{(9)} \] (We also note that \(a,b,c \neq 0\); otherwise, e.g., \(a = 0\) would imply \(A = X\), and then \(e = k \cdot 0 = 0\), so \(A\) and \(E\) coincide, making \(\triangle AFE\) degenerate - impossible. Hence \(a,b,c\) are non-zero.)

4. The Origin Lies on the Three Circles

We now show that the origin \(0\) belongs to the circumcircles of \(\triangle AFE\), \(\triangle BDF\), and \(\triangle CED\).

Lemma (Cross Ratio and Concyclicity). Four distinct points \(z_1,z_2,z_3,z_4\) in the complex plane lie on a common circle or line if and only if their cross ratio

\[ (z_1,z_2;z_3,z_4) = \frac{(z_1 - z_3)(z_2 - z_4)}{(z_1 - z_4)(z_2 - z_3)} \] is a real number.

Proof. The M\"obius transformation

\[ T(z) = \frac{(z - z_1)(z_2 - z_3)}{(z - z_3)(z_2 - z_1)} \] maps \(z_1,z_2,z_3\) to \(0,1,\infty\) respectively. Under \(T\), the circle/line through \(z_1,z_2,z_3\) is mapped to the real line. Hence \(z_4\) lies on that circle/line exactly when \(T(z_4)\) is real, and \(T(z_4)\) equals the cross ratio \((z_1,z_2;z_3,z_4)\).

Circle \((AFE)\)

Take \(z_1 = a\), \(z_2 = f\), \(z_3 = e\), \(z_4 = 0\). Using (9):

\[ a - e = a - k a = a(1 - k),\quad f - 0 = k b,\quad a - 0 = a,\quad f - e = k b - k a = k(b - a). \] Thus

\[ (a,f;e,0) = \frac{(a - e)(f - 0)}{(a - 0)(f - e)} = \frac{a(1 - k) \cdot k b}{a \cdot k(b - a)} = \frac{(1 - k)b}{b - a}. \quad\text{(10)} \] Because \(A,F,B\) are collinear, the ratio \(\dfrac{f - a}{b - a}\) is real. Compute

\[ \frac{f - a}{b - a} = \frac{k b - a}{b - a}. \] Now

\[ \frac{(1 - k)b}{b - a} = 1 - \frac{k b - a}{b - a}, \] which is therefore real. The points \(a,f,e\) are not collinear (otherwise \(\triangle AFE\) would be degenerate). By the lemma, \(0\) lies on the circle through \(a,f,e\), i.e.,

\[ 0 \in (AFE). \quad\text{(11)} \]
Circle \((BDF)\)

Take \(z_1 = b\), \(z_2 = d\), \(z_3 = f\), \(z_4 = 0\). Using (9):

\[ b - d = b - k c,\quad f - 0 = k b,\quad b - 0 = b,\quad f - d = k b - k c = k(b - c). \] Hence

\[ (b,d;f,0) = \frac{(b - d)(f - 0)}{(b - 0)(f - d)} = \frac{(b - k c) \cdot k b}{b \cdot k(b - c)} = \frac{b - k c}{b - c}. \quad\text{(12)} \] Collinearity of \(B,D,C\) gives \(\dfrac{d - b}{c - b} \in \mathbb{R}\):

\[ \frac{k c - b}{c - b} \in \mathbb{R}. \] Observe that

\[ \frac{b - k c}{b - c} = \frac{-(k c - b)}{-(c - b)} = \frac{k c - b}{c - b}, \] so the cross ratio is real. Since \(b,d,f\) are non-collinear (triangle \(BDF\) is non-degenerate), the lemma yields

\[ 0 \in (BDF). \quad\text{(13)} \]
Circle \((CED)\)

Take \(z_1 = c\), \(z_2 = e\), \(z_3 = d\), \(z_4 = 0\). Using (9):

\[ c - e = c - k a,\quad d - 0 = k c,\quad c - 0 = c,\quad d - e = k c - k a = k(c - a). \] Thus

\[ (c,e;d,0) = \frac{(c - e)(d - 0)}{(c - 0)(d - e)} = \frac{(c - k a) \cdot k c}{c \cdot k(c - a)} = \frac{c - k a}{c - a}. \quad\text{(14)} \] Collinearity of \(C,E,A\) gives \(\dfrac{e - c}{a - c} \in \mathbb{R}\):

\[ \frac{k a - c}{a - c} \in \mathbb{R}. \] Since

\[ \frac{c - k a}{c - a} = \frac{-(k a - c)}{-(a - c)} = \frac{k a - c}{a - c}, \] the cross ratio is real. Non-collinearity of \(c,e,d\) gives

\[ 0 \in (CED). \quad\text{(15)} \]
5. \(k\) is Not Real

Suppose, for contradiction, that \(k \in \mathbb{R}\). Then from (9) we have \(e = k a\), so points \(0\), \(a\), \(e\) are collinear (they lie on the line through the origin and \(a\)). However, by (11) all three points \(0,a,e\) lie on the circle \((AFE)\). A non-degenerate circle cannot contain three distinct collinear points. This contradiction forces

\[ k \notin \mathbb{R}. \quad\text{(16)} \] (Recall \(k \neq 0,1\); therefore \(0,1,k\) are distinct and not collinear.)

6. Circumcenters \(O_A,O_B,O_C\)

Since \(0\) lies on \((AFE)\), the circle through \(a,f,e\) coincides with the circle through \(0,a,e\) (because three non-collinear points determine a circle, and \(0,a,e\) are distinct and, because \(k \notin \mathbb{R}\), they are not collinear). Hence \(O_A\) is the circumcenter of \(\triangle (0,a,e)\).

Now consider the triangle with vertices \(0,1,k\). As \(k \notin \mathbb{R}\) and \(k \neq 0,1\), these points are distinct and non-collinear. Let \(\mu\) be its circumcenter; thus

\[ |\mu - 0| = |\mu - 1| = |\mu - k|. \quad\text{(17)} \] We claim that \(O_A = a \mu\). Indeed, the map \(z \mapsto a z\) (a spiral similarity about \(0\)) sends

\[ 0 \mapsto 0,\quad 1 \mapsto a,\quad k \mapsto k a = e. \] Under a similarity, the image of the circumcenter of a triangle is the circumcenter of the image triangle. Therefore \(a \mu\) is the circumcenter of \(\triangle (0,a,e)\), i.e., \(O_A = a \mu\).

One may also verify directly: The distances from \(a\mu\) to \(0,a,e\) are

\[ |a\mu - 0| = |a|\,|\mu|,\quad |a\mu - a| = |a|\,|\mu - 1|,\quad |a\mu - e| = |a|\,|\mu - k|, \] and by (17) these three numbers are equal, so \(a\mu\) is equidistant from \(0,a,e\). Because \(0,a,e\) are not collinear, \(a\mu\) is the unique point with that property, hence it is the circumcenter.

Analogously, applying the same reasoning to the other two circles, we obtain

\[ O_B = b \mu,\qquad O_C = c \mu. \quad\text{(18)} \]
7. Circumcenters \(M\), \(N\), \(O\)

Let \(M\) be the circumcenter of \(\triangle ABC\), so

\[ |M - a| = |M - b| = |M - c| =: R. \quad\text{(19)} \]
Circumcenter \(O\) of \(\triangle O_A O_B O_C\)

The vertices are \(O_A = a\mu\), \(O_B = b\mu\), \(O_C = c\mu\). Consider the point \(\mu M\):

\[ |\mu M - O_A| = |\mu M - a\mu| = |\mu|\,|M - a| = |\mu| R, \] \[ |\mu M - O_B| = |\mu M - b\mu| = |\mu|\,|M - b| = |\mu| R, \] \[ |\mu M - O_C| = |\mu M - c\mu| = |\mu|\,|M - c| = |\mu| R. \] Thus \(\mu M\) is equidistant from \(O_A,O_B,O_C\). Since \(\triangle O_A O_B O_C\) is non-degenerate (it is the image of \(\triangle ABC\) under the non-zero similarity \(z \mapsto \mu z\)), \(\mu M\) is the circumcenter:

\[ O = \mu M. \quad\text{(20)} \]
Circumcenter \(N\) of \(\triangle DEF\)

The vertices are \(D = k c\), \(E = k a\), \(F = k b\). Consider the point \(k M\):

\[ |k M - D| = |k M - k c| = |k|\,|M - c| = |k| R, \] \[ |k M - E| = |k M - k a| = |k|\,|M - a| = |k| R, \] \[ |k M - F| = |k M - k b| = |k|\,|M - b| = |k| R. \] Hence \(k M\) is equidistant from \(D,E,F\), and because \(\triangle DEF\) is non-degenerate (it is similar to \(\triangle ABC\) and, under the given configuration, non-degenerate), we have

\[ N = k M. \quad\text{(21)} \] (If \(M = 0\), then \(O = 0\), \(N = 0\), and the equalities hold trivially.)

8. Proof of \(OM = ON\)

Using (20) and (21),

\[ OM = |O - M| = |\mu M - M| = |M|\,|\mu - 1|, \] \[ ON = |O - N| = |\mu M - k M| = |M|\,|\mu - k|. \] Now \(\mu\) is the circumcenter of \(\triangle (0,1,k)\), so by (17)

\[ |\mu - 1| = |\mu - k|. \] Consequently,

\[ OM = |M|\,|\mu - 1| = |M|\,|\mu - k| = ON. \]
9. Conclusion

We have shown that under the given conditions the distances \(OM\) and \(ON\) are equal.

\[ \boxed{OM = ON}. \]

Question

Let $a$ and $b$ be positive integers such that $\varphi(ab+1)$ divides $a^2 + b^2 + 1$. Prove that $a$ and $b$ are Fibonacci numbers.

Answer
Expert verdict: 7/7

Let \(a\) and \(b\) be positive integers such that

\[ \varphi(ab+1) \mid a^{2}+b^{2}+1. \] Set \(N = ab+1\) and define the positive integer

\[ k = \frac{a^{2}+b^{2}+1}{\varphi(N)}. \] We will prove that both \(a\) and \(b\) must be Fibonacci numbers.

1. Preliminary bounds

Since \(N > 1\), we have \(\varphi(N) \le N-1 = ab\) (with equality exactly when \(N\) is prime). Hence

\[ a^{2}+b^{2}+1 = k\,\varphi(N) \le k\,ab. \quad\text{(1)} \] By the quadratic-mean-arithmetic-mean inequality, \(a^{2}+b^{2} \ge 2ab\), so

\[ a^{2}+b^{2}+1 \ge 2ab+1. \quad\text{(2)} \] Combining (1) and (2) yields

\[ 2ab+1 \le k\,ab \quad\Longrightarrow\quad k \ge 2 + \frac{1}{ab}. \] Because \(k\) is an integer, if \(ab > 1\) we obtain \(k \ge 3\). If \(ab = 1\) then necessarily \(a=b=1\), \(N=2\), \(\varphi(2)=1\), and then \(k = 3\). Thus in every case

\[ \boxed{k \ge 3}. \quad\text{(3)} \]
2. Parity and the even case

Lemma 2.1. If \(N\) is even and \(N>2\), then the divisibility condition cannot hold.

Proof. For \(N>2\), \(\varphi(N)\) is even (a standard fact: \(\varphi(n)\) is even for every \(n>2\)). Because \(N\) even implies \(ab = N-1\) odd, both \(a\) and \(b\) are odd. Then \(a^{2}+b^{2}+1\) is odd (odd+odd+1). An even number cannot divide an odd number. The only even possibility is \(N=2\), which gives \(a=b=1\) and indeed \(\varphi(2)=1\) divides \(3\).

Consequently, the only even \(N\) that can occur is \(N=2\), producing \((a,b)=(1,1)\) - both Fibonacci numbers. From now on we assume

\[ N\ \text{is odd and}\ N>2. \] Then \(ab = N-1\) is even, so at least one of \(a,b\) is even. If both were even, \(a^{2}+b^{2}+1\) would be odd, while for odd \(N>2\) we still have \(\varphi(N)\) even. Hence exactly one of \(a,b\) is even and the other is odd. In particular,

\[ a^{2}+b^{2}+1 \equiv 0+1+1 \equiv 2 \pmod{4}. \quad\text{(4)} \]
3. Case I: \(N\) is prime

Assume \(N = ab+1\) is prime. Then \(\varphi(N) = N-1 = ab\), and (1) becomes

\[ a^{2}+b^{2}+1 = k\,ab. \quad\text{(5)} \] We first determine \(k\).

3.1. The value of \(k\)

Without loss of generality, order the variables so that \(a \le b\). Write (5) as a quadratic in \(b\):

\[ b^{2} - (k a)\,b + (a^{2}+1) = 0. \] If \(b\) is a root, the other root is

\[ b' = \frac{a^{2}+1}{b} = k a - b, \] which is a positive integer.

Claim. If \(a \ge 2\), then \(b' < b\).

Proof. Suppose \(b' \ge b\). Then \(\frac{a^{2}+1}{b} \ge b\), i.e. \(a^{2}+1 \ge b^{2}\). Because \(b \ge a\), we have \(a^{2} \le b^{2} \le a^{2}+1\). Hence either \(b^{2}=a^{2}\) or \(b^{2}=a^{2}+1\).

If \(b^{2}=a^{2}\), then \(b=a\). Substituting \(b=a\) into (5) gives \(2a^{2}+1 = k a^{2}\) \(\Rightarrow\) \(k = 2 + \frac{1}{a^{2}}\), which is not an integer for \(a \ge 2\). Contradiction.

If \(b^{2}=a^{2}+1\), then \(a^{2}+1\) is a perfect square. For \(a \ge 2\), this is impossible because between \(a^{2}\) and \((a+1)^{2}=a^{2}+2a+1\) there is no other square.

Thus whenever \(a \ge 2\), we can replace \((a,b)\) by \((a,b')\) (which is also a solution of (5)) with \(a+b' < a+b\). Repeating this descent (the sum \(a+b\) strictly decreases each step) we eventually reach a solution with \(a=1\) (the minimal sum cannot have \(a \ge 2\)).

Now consider \(a=1\). Equation (5) becomes

\[ 1 + b^{2} + 1 = k \cdot 1 \cdot b \quad\Longrightarrow\quad b^{2} - k b + 2 = 0. \quad\text{(6)} \] For integer \(b\), the discriminant \(\Delta = k^{2}-8\) must be a perfect square, say \(d^{2}\). Then

\[ k^{2} - d^{2} = 8 \quad\Longrightarrow\quad (k-d)(k+d)=8. \] Both factors are positive integers of the same parity. The factor pairs of \(8\) are \((1,8)\) and \((2,4)\).

\((1,8)\) gives \(k-d=1\), \(k+d=8\) \(\Rightarrow\) \(2k=9\) \(\Rightarrow\) \(k=9/2\), not integer.

\((2,4)\) gives \(k-d=2\), \(k+d=4\) \(\Rightarrow\) \(2k=6\) \(\Rightarrow\) \(k=3\), \(d=1\).

Hence \(k=3\) is forced. With \(k=3\), equation (6) is \(b^{2}-3b+2=0\), whose roots are \(b=1\) and \(b=2\). Thus the only solutions with \(a=1\) are \((1,1)\) and \((1,2)\) (and by symmetry, \((2,1)\) if we had not assumed \(a\le b\)). Since the reduction process preserves \(k\), every solution of (5) must have \(k=3\).

Therefore, when \(N\) is prime,

\[ a^{2}+b^{2}+1 = 3ab \quad\Longleftrightarrow\quad a^{2} - 3ab + b^{2} = -1. \quad\text{(7)} \]
3.2. Solving \(a^{2} - 3ab + b^{2} = -1\)

Equation (7) is symmetric; we may assume \(a \le b\).

Define a sequence \((A_n)_{n\ge 0}\) by

\[ A_0 = 1,\qquad A_1 = 1,\qquad A_{n+2} = 3A_{n+1} - A_n\ \ (n\ge 0). \] One verifies by induction that \((A_n, A_{n+1})\) satisfies (7): For \(n=0\), \(1^2-3\cdot1\cdot1+1^2=-1\). Assuming it holds for \(n\), using the recurrence one checks that it also holds for \(n+1\). (The computation is straightforward and can be filled in similarly to the proof in Lemma 4.1 of the original draft.)

Now let \((a,b)\) be any positive integer solution of (7) with \(a \le b\). View (7) as a quadratic in \(b\):

\[ b^{2} - 3a\, b + (a^{2}+1) = 0. \] Its two roots are \(b\) and

\[ b' = \frac{a^{2}+1}{b} = 3a - b, \] which is an integer. A similar argument as in 3.1 shows that if \(a \ge 2\), then \(b' < b\). Consequently, by infinite descent on \(a+b\), we can reduce any solution to one with \(a=1\). The only solutions with \(a=1\) are \((1,1)\) and \((1,2)\) (and their symmetric versions). Therefore every solution can be obtained from these minimal ones by the inverse transformation: if \((x,y)\) is a solution with \(x \le y\), then \((y,\, 3y - x)\) is also a solution. Starting from \((1,1)\) and repeatedly applying this transformation yields the increasing sequence

\[ (1,1),\ (1,2),\ (2,5),\ (5,13),\ (13,34),\ \dots \] which exactly corresponds to the pairs \((A_n, A_{n+1})\) for \(n\ge 0\).

It remains to identify these \(A_n\) with Fibonacci numbers. Define the Fibonacci numbers by

\[ F_1 = 1,\quad F_2 = 1,\quad F_{n+2} = F_{n+1} + F_n. \] We claim that for \(n \ge 1\),

\[ A_n = F_{2n-1}. \] Proof by induction.

Base \(n=1\): \(A_1 = 1 = F_1\).

\(n=2\): \(A_2 = 3A_1 - A_0 = 3\cdot1 - 1 = 2 = F_3\).

Inductive step: Assume \(A_n = F_{2n-1}\) and \(A_{n+1} = F_{2n+1}\). Then

\[ A_{n+2} = 3A_{n+1} - A_n = 3F_{2n+1} - F_{2n-1}. \] Using the identities \[ F_{2n+1} - F_{2n-1} = F_{2n},\quad \text{and}\quad F_{2n+1} + F_{2n} = F_{2n+2}, \] we compute

\[ \begin{aligned} 3F_{2n+1} - F_{2n-1} &= 2F_{2n+1} + (F_{2n+1} - F_{2n-1}) \\ &= 2F_{2n+1} + F_{2n} \\ &= F_{2n+1} + (F_{2n+1} + F_{2n}) \\ &= F_{2n+1} + F_{2n+2} \\ &= F_{2n+3}. \end{aligned} \] Thus \(A_{n+2} = F_{2n+3} = F_{2(n+2)-1}\), completing the induction.

Hence all solutions of (7) are pairs of Fibonacci numbers (specifically, consecutive odd-index Fibonacci numbers). This completes Case I.

4. Case II: \(N\) is composite and odd (\(N>2\))

Now \(N = ab+1\) is composite, odd, and \(N>2\). From (4) we have

\[ a^{2}+b^{2}+1 \equiv 2 \pmod{4}. \]
4.1. \(N\) cannot have two distinct odd prime factors

Suppose \(N\) has at least two distinct odd prime divisors \(p\) and \(q\). Then \(\varphi(N)\) is divisible by \((p-1)(q-1)\). Since \(p\) and \(q\) are odd, both \(p-1\) and \(q-1\) are even, hence \(4 \mid (p-1)(q-1) \mid \varphi(N)\). Thus \(4 \mid \varphi(N)\). Since \(\varphi(N) \mid a^{2}+b^{2}+1\), we would have \(4 \mid a^{2}+b^{2}+1\), contradicting (4). Therefore \(N\) cannot possess two distinct odd prime factors.

It follows that \(N\) must be a prime power:

\[ N = p^{e}, \qquad e \ge 2\ (\text{since } N \text{ is composite}). \]
4.2. The prime \(p\) cannot be \(\equiv 1 \pmod{4}\)

If \(p \equiv 1 \pmod{4}\), then \(p-1\) is divisible by \(4\), so \(4 \mid \varphi(N)\). Again this forces \(4 \mid a^{2}+b^{2}+1\), which is impossible by (4). Hence

\[ p \equiv 3 \pmod{4}. \quad\text{(8)} \]
4.3. Analysis modulo \(3\)

We now examine the residue of \(p\) modulo \(3\).

Subcase \(p \equiv 1 \pmod{3}\). Then \(3 \mid (p-1)\), so \(3 \mid \varphi(N)\). Moreover, \(p \equiv 1 \pmod{3}\) implies \(p^{e} \equiv 1 \pmod{3}\), so \(ab = p^{e} - 1 \equiv 0 \pmod{3}\). Thus \(3 \mid ab\).

Now evaluate \(S = a^{2}+b^{2}+1\) modulo \(3\). Since \(3 \mid ab\), there are two possibilities:

\(3 \mid a\) and \(3 \mid b\): then \(a^{2}\equiv0\), \(b^{2}\equiv0\), so \(S \equiv 1 \pmod{3}\).

Exactly one of \(a,b\) is divisible by \(3\): then \(S \equiv 0+1+1 = 2 \pmod{3}\).

In neither case is \(S\) divisible by \(3\). However, \(\varphi(N) \mid S\) and \(3 \mid \varphi(N)\) would force \(3 \mid S\). Contradiction. Therefore \(p \not\equiv 1 \pmod{3}\).

Subcase \(p \equiv 2 \pmod{3}\). Then \(p-1 \equiv 1 \pmod{3}\), so \(3 \nmid (p-1)\). But because \(e \ge 2\), \(\varphi(N) = p^{e-1}(p-1)\) contains the factor \(p^{e-1}\), so in particular \(p \mid \varphi(N)\). Consequently,

\[ p \mid S. \quad\text{(9)} \] Also, from \(ab = p^{e} - 1\) we have

\[ ab \equiv -1 \pmod{p}. \quad\text{(10)} \] In particular, \(p\) does not divide \(a\) or \(b\) (otherwise (10) would give \(0 \equiv -1 \pmod{p}\), impossible). Hence \(a\) and \(b\) are invertible modulo \(p\). Write \(b \equiv -a^{-1} \pmod{p}\). Substituting into (9):

\[ a^{2} + (-a^{-1})^{2} + 1 \equiv 0 \pmod{p}, \] i.e., \[ a^{2} + a^{-2} + 1 \equiv 0 \pmod{p}. \] Multiply by \(a^{2}\) (invertible modulo \(p\)):

\[ a^{4} + a^{2} + 1 \equiv 0 \pmod{p}. \quad\text{(11)} \] Set \(y = a^{2} \pmod{p}\); then (11) becomes

\[ y^{2} + y + 1 \equiv 0 \pmod{p}. \quad\text{(12)} \] Equation (12) has a solution in \(\mathbb{F}_p\) iff \(-3\) is a quadratic residue modulo \(p\). Indeed, multiplying (12) by \(4\) gives \((2y+1)^{2} \equiv -3 \pmod{p}\).

We need the following standard lemma:

Lemma. For an odd prime \(p \neq 3\), \(-3\) is a quadratic residue modulo \(p\) if and only if \(p \equiv 1 \pmod{3}\).

Proof. The multiplicative group \(\mathbb{F}_p^{\times}\) is cyclic of order \(p-1\). The equation \(y^{2}+y+1=0\) is equivalent to \(y^{3}=1\) with \(y \neq 1\) (since \((y-1)(y^{2}+y+1)=y^{3}-1\). Hence a solution exists iff the group contains an element of order \(3\), i.e., iff \(3 \mid p-1\), which is \(p \equiv 1 \pmod{3}\). Conversely, if \(p \equiv 1 \pmod{3}\), then \(3 \mid p-1\), so such an element exists.

Since \(p \equiv 2 \pmod{3}\), we have \(p-1\) not divisible by \(3\), so there is no element of order \(3\) in \(\mathbb{F}_p^{\times}\); therefore (12) has no solution modulo \(p\). This contradicts the existence of \(a\). Thus \(p \not\equiv 2 \pmod{3}\).

The only remaining possibility for the odd prime \(p\) is \(p = 3\).

4.4. The exponent \(e\)

Now \(N = 3^{e}\) with \(e \ge 2\). Then

\[ \varphi(N) = 3^{e-1} \cdot 2. \] If \(e \ge 3\): Then \(3^{e-1}\) is at least \(3^{2}=9\), so \(9 \mid \varphi(N)\). Since \(\varphi(N) \mid S\), we must have \(9 \mid S\).

But we will show that \(S \equiv 3 \pmod{9}\), which is not divisible by \(9\), a contradiction. Let us verify this congruence.

Because \(e \ge 3\), \(N = 3^{e}\) is divisible by \(27\), in particular \(N \equiv 0 \pmod{9}\). Hence

\[ ab = N-1 \equiv -1 \pmod{9}. \quad\text{(13)} \] Moreover, \(N \equiv 0 \pmod{3}\) gives \(ab \equiv -1 \equiv 2 \pmod{3}\). Hence \(3 \nmid a\) and \(3 \nmid b\) (otherwise \(ab \equiv 0 \pmod{3}\)). Thus \(a\) and \(b\) are each \(\equiv 1\) or \(2 \pmod{3}\), and their product is \(2 \pmod{3}\); the only possibilities are \(\{a,b\} \equiv \{1,2\} \pmod{3}\). Consequently,

\[ a + b \equiv 1 + 2 \equiv 0 \pmod{3}. \quad\text{(14)} \] Now compute

\[ S = a^{2}+b^{2}+1 = (a+b)^{2} - 2ab + 1. \] From (14), \(a+b = 3t\) for some integer \(t\), so \((a+b)^{2} = 9t^{2} \equiv 0 \pmod{9}\). Using (13), \(ab \equiv -1 \pmod{9}\), so \(-2ab \equiv -2(-1) = 2 \pmod{9}\). Thus

\[ S \equiv 0 + 2 + 1 = 3 \pmod{9}. \] Thus \(9 \nmid S\), contradicting \(9 \mid \varphi(N) \mid S\). Therefore \(e\) cannot be \(\ge 3\).

The only remaining possibility is \(e = 2\), i.e., \(N = 9\). Then \(\varphi(9) = 6\) and \(ab = 8\). The positive factor pairs of \(8\) are

\[ (1,8),\ (2,4),\ (4,2),\ (8,1). \] Compute \(S\) for each:

\((1,8)\): \(S = 1 + 64 + 1 = 66\), and \(66 / 6 = 11 \in \mathbb{Z}\).

\((2,4)\): \(S = 4 + 16 + 1 = 21\), \(21/6 = 3.5 \notin \mathbb{Z}\).

Thus only \((1,8)\) and \((8,1)\) satisfy the divisibility condition. Both \(1\) and \(8\) are Fibonacci numbers (\(1 = F_1\), \(8 = F_6\)).

5. Conclusion

We have examined all possible values of \(N = ab+1\):

\textbf{Even case:

\(N=2\) gives \((a,b)=(1,1)\) - Fibonacci numbers.}

\textbf{Prime case:

\(N\) prime leads to the equation \(a^{2} - 3ab + b^{2} = -1\), whose complete set of positive integer solutions consists of pairs of Fibonacci numbers (as shown in 3.2).}

\textbf{Composite case:

\(N\) composite forces \(N=9\) and yields \((a,b) = (1,8)\) or \((8,1)\), again Fibonacci numbers.} Hence, under the hypothesis \(\varphi(ab+1) \mid a^{2}+b^{2}+1\), the integers \(a\) and \(b\) are necessarily Fibonacci numbers.

Remark. The Fibonacci numbers are defined by \(F_1=F_2=1\) and \(F_{n+2}=F_{n+1}+F_n\). The solutions from the prime case are precisely \((F_{2n-1},F_{2n+1})\) (and symmetric) for \(n \ge 1\), together with the degenerate pair \((1,1)\) which can be seen as \((F_1,F_2)\) or \((F_2,F_1)\). The pair \((1,8)\) from the composite case also fits the Fibonacci sequence (\(F_1=1\), \(F_6=8\)). This completes the proof.