A positive integer $n$ is tripariable if it is possible to partition the set $\{1, 2, \dots, n\}$ into disjoint pairs such that the sum of two elements in each pair is a power of $3$. For example $6$ is tripariable because $\{1, 2, \dots, n\}=\{1,2\}\cup\{3,6\}\cup\{4,5\}$ and $$1+2=3^1,\quad 3+6 = 3^2\quad\text{and}\quad4+5=3^2$$are all powers of 3. How many positive integers less than or equal to 2024 are tripariable?
Problem
Source: SMMC 2024 A2
Tags: number theory
13.10.2024 14:04
We claim that the answer is $\boxed{111}$, and consists of all numbers having no $1$ in their ternary (base $3$) expansion. We state the key claims that are easy to demonstrate: Claim 1: Let $k=\lfloor\log_3 n\rfloor$. Then $2\cdot 3^k \le n \le 3^{k+1}-1$. Proof: The RHS follows from $\lfloor x\rfloor \le x$ and the fact that we arr working in integers. Clearly, $n\ge 3^k$. Since $n$ is even due to the pairing, $3^k\in \left\{1, 2, \dots, n\right\}$. To make this pair, we must have a number $\ge 3^{k+1}-3^k$ in $[n]$. Divide $[n]$ into three groups: first starting from 1 upto $3^k-1$; second starting from $3^k$ upto $2\cdot 3^k$; and the third consisting of the rest. Claim 2: The second group elements must be paired among themselves. Proof: Easy inequalities and definition chasing. Claim 3: The third group elements must be paired to some first group elements. Proof: Again, use inequalities. If you used the correct inequalities in Claim 3, you get that the only valid power of $3$ that can be produced by pairs having a group three member is $3^{k+1}$. Thus, all numbers $>3^{k+1}-n-1$ are paired (and this is the only possible way of pairing them). Now induct down noting that $3^{k+1}-1=\underbrace{(22\cdots 2)}_{k\text{ times}}$ in base 3.
24.10.2024 15:05
iflugkiwmu wrote: A positive integer $n$ is tripariable if it is possible to partition the set $\{1, 2, \dots, n\}$ into disjoint pairs such that the sum of two elements in each pair is a power of $3$. For example $6$ is tripariable because $\{1, 2, \dots, n\}=\{1,2\}\cup\{3,6\}\cup\{4,5\}$ and $$1+2=3^1,\quad 3+6 = 3^2\quad\text{and}\quad4+5=3^2$$are all powers of 3. How many positive integers less than or equal to 2024 are tripariable? It is Problem 4 from JBMO 2022. See here.