MathDB
Break 1,2,...,n into pairs with sums being powers of 3

Source: SMMC 2024 A2

October 12, 2024
number theory

Problem Statement

A positive integer nn is tripariable if it is possible to partition the set {1,2,,n}\{1, 2, \dots, n\} into disjoint pairs such that the sum of two elements in each pair is a power of 33. For example 66 is tripariable because {1,2,,n}={1,2}{3,6}{4,5}\{1, 2, \dots, n\}=\{1,2\}\cup\{3,6\}\cup\{4,5\} and 1+2=3^1,  3+6 = 3^2 \text{and} 4+5=3^2 are all powers of 3.
How many positive integers less than or equal to 2024 are tripariable?