Maths Olympiad Prep

Track / Stage 6 / 360 of 400 #1360 of 1964

Problem 1360

National olympiad, first round
Number theory Difficulty 6.8 Find the answer

You are given n2n \ge 2 distinct positive integers. Let's call a pair of these integers [i]elegant[/i] if their sum is an integer power of 22. For every nn find the largest possible number of elegant pairs.

[i]Proposed by Oleksiy Masalitin[/i]

A number or a short expression. Spacing and $ signs are ignored.

Official solution

1. Define the Problem in Graph Theory Terms:
We are given n2 n \ge 2 distinct positive integers. We need to find the largest possible number of pairs whose sum is a power of 2. We can represent this problem using a graph G G with n n vertices, where each vertex represents one of the integers. An edge is drawn between two vertices if and only if their sum is a power of 2.

2. **Claim 1: The Graph G G has no cycles.
-
Proof:**
Suppose, for contradiction, that G G contains a cycle. Let the cycle be a1,a2,,ak,a1 a_1, a_2, \ldots, a_k, a_1 with k3 k \geq 3 . Assume a1+a2 a_1 + a_2 is the largest sum among all ai+ai+1 a_i + a_{i+1} . Since a1+a2 a_1 + a_2 is a power of 2, let it be 2x 2^x . Similarly, let a2+a3=2y a_2 + a_3 = 2^y and ak+a1=2z a_k + a_1 = 2^z with x>y x > y and x>z x > z .
- If y>z y > z , then 2x2y+1>2y+2z 2^x \geq 2^{y+1} > 2^y + 2^z , which is a contradiction.
- If y<z y < z , then 2x2z+1>2y+2z 2^x \geq 2^{z+1} > 2^y + 2^z , which is also a contradiction.
Therefore, G G cannot contain any cycles. \blacksquare

3. **Claim 2: Any acyclic simple undirected graph G G on n n vertices has at most n1 n-1 edges.
-
Proof:**
We proceed by induction on n n .
- Base Case: For n=2 n = 2 , the graph can have at most 1 edge, which is n1 n-1 . The base case holds.
- Inductive Step: Assume the statement is true for graphs with n n vertices. Consider a graph with n+1 n+1 vertices. We need to show that this graph has at most n n edges.
- Take a maximal path v1,v2,,vt v_1, v_2, \ldots, v_t in the graph. Vertex v1 v_1 has no neighbors among vi v_i (for i>2 i > 2 ) since otherwise, it would form a cycle, contradicting the acyclic property. Therefore, v1 v_1 can only have v2 v_2 as a neighbor, implying deg(v1)1 \deg(v_1) \leq 1 .
- Remove v1 v_1 and its edge (if it exists). The remaining subgraph on n n vertices has at most n1 n-1 edges by the inductive hypothesis. Adding back v1 v_1 and its edge gives at most n n edges in total.
Thus, any acyclic graph on n+1 n+1 vertices has at most n n edges. \blacksquare

4. Conclusion:
From Claims 1 and 2, the graph G G has at most n1 n-1 edges. This means the maximum number of elegant pairs is n1 n-1 .

5. **Constructing a Graph with n1 n-1 Elegant Pairs:**
To show that n1 n-1 elegant pairs are attainable, consider the following construction:
- Let a1=1 a_1 = 1 and ai=2ni a_i = 2^n - i for i=2,3,,n i = 2, 3, \ldots, n .
- For each i1 i \neq 1 , a1+ai=1+(2ni)=2n(i1) a_1 + a_i = 1 + (2^n - i) = 2^n - (i - 1) , which is a power of 2.
- This construction ensures that there are n1 n-1 elegant pairs.

The final answer is n1 \boxed{ n-1 } .

Source: NuminaMath-1.5, licensed Apache-2.0. Statement and solution reproduced as published; topic, difficulty and ordering added by this site.