Problem

Source: Ukrainian Mathematical Olympiad 2023. Day 2, Problem 9.7

Tags: number theory



You are given $n \ge 2$ distinct positive integers. Let's call a pair of these integers elegant if their sum is an integer power of $2$. For every $n$ find the largest possible number of elegant pairs. Proposed by Oleksiy Masalitin