TOPICS
Search

Power of Two Pair Sum Problem


The power of two pair sum problem asks for the maximum number g(n) of unordered pairs of distinct elements of an n-element set of integers whose sum is 2^k for some integer k>=0. Ullman and Wagon (2021) posed the problem for n=10. Different pairs with the same sum count separately. For example, {-3,-1,3,5} gives four qualifying pairs with sums 2, 2, 4, and 8 (Numberphile 2022).

Join two integers by an edge if their sum is a power of 2. The problem is to maximize the number of edges of the resulting graph. The graph contains no cycle of length 4. In such a cycle the two opposite pairs of edge sums have the same total. A sum of two powers of 2 uniquely determines the unordered pair of powers, including when the powers are equal. Matching equal edge sums across the opposite pairs would therefore give two incident edges with equal sums, forcing the other two endpoints to have equal labels (Alekseyev 2026).

The values of g(n) for n=1, 2, ..., 21 are 0, 1, 3, 4, 6, 7, 9, 11, 13, 15, 17, 19, 21, 24, 26, 29, 31, 34, 36, 39, and 41 (OEIS A352178). Alekseyev (2026) determined the values for 12<=n<=21 using an algorithm that tests whether a given graph admits distinct integer labels with power-of-two sums along its edges.


See also

Extremal Graph Theory, Power

Explore with Wolfram|Alpha

References

Alekseyev, M. A. "Maximizing the Number of Integer Pairs Summing to Powers of 2 via Graph Labeling and Solving Restricted Systems of Linear (In)equations." J. Comput. Syst. Sci. 157, 103735, 2026. https://doi.org/10.1016/j.jcss.2025.103735.Numberphile. "Problems with Powers of Two." Featuring N. J. A. Sloane. Sep. 21, 2022. https://www.youtube.com/watch?v=IPoh5C9CcI8.Ullman, D. and Wagon, S. "Problem 1321: Powers of Two." Problem of the Week. Apr. 16, 2021. https://oeis.org/A347301/a347301_1.pdf.Sloane, N. J. A. Sequence A352178 in "The On-Line Encyclopedia of Integer Sequences."

Cite this as:

Weisstein, Eric W. "Power of Two Pair Sum Problem." From MathWorld--A Wolfram Resource. https://mathworld.wolfram.com/PowerofTwoPairSumProblem.html

Subject classifications