You are given distinct positive integers. Let's call a pair of these integers [i]elegant[/i] if their sum is an integer power of . For every find the largest possible number of elegant pairs.
[i]Proposed by Oleksiy Masalitin[/i]
You are given distinct positive integers. Let's call a pair of these integers [i]elegant[/i] if their sum is an integer power of . For every find the largest possible number of elegant pairs.
[i]Proposed by Oleksiy Masalitin[/i]
1. Define the Problem in Graph Theory Terms:
We are given 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 with 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 has no cycles.
- Proof:**
Suppose, for contradiction, that contains a cycle. Let the cycle be with . Assume is the largest sum among all . Since is a power of 2, let it be . Similarly, let and with and .
- If , then , which is a contradiction.
- If , then , which is also a contradiction.
Therefore, cannot contain any cycles.
3. **Claim 2: Any acyclic simple undirected graph on vertices has at most edges.
- Proof:**
We proceed by induction on .
- Base Case: For , the graph can have at most 1 edge, which is . The base case holds.
- Inductive Step: Assume the statement is true for graphs with vertices. Consider a graph with vertices. We need to show that this graph has at most edges.
- Take a maximal path in the graph. Vertex has no neighbors among (for ) since otherwise, it would form a cycle, contradicting the acyclic property. Therefore, can only have as a neighbor, implying .
- Remove and its edge (if it exists). The remaining subgraph on vertices has at most edges by the inductive hypothesis. Adding back and its edge gives at most edges in total.
Thus, any acyclic graph on vertices has at most edges.
4. Conclusion:
From Claims 1 and 2, the graph has at most edges. This means the maximum number of elegant pairs is .
5. **Constructing a Graph with Elegant Pairs:**
To show that elegant pairs are attainable, consider the following construction:
- Let and for .
- For each , , which is a power of 2.
- This construction ensures that there are elegant pairs.
The final answer is .