Prove that any positive integer can be represented as an aggregate of different powers of $3$, the terms in the aggregate being combined by the signs $+$ and $-$ appropriately chosen.
Problem
Source:
Tags: algorithm, Additive Number Theory
24.10.2007 23:16
Is it correct? Let $ A=(a_0, a_1,\cdots,a_k)$ the digits of $ n$ in base $ 3$ $ (n=a_0+3a_1 +\cdots +3^k a_k)$ and $ a_i \in \{0,1,2\}$ Let $ g(A)=$ the amount of digits $ 2$ in $ A$ $ 1)$ If $ a_k=2$ then redefine $ A=(a_0,a_1,\cdots,a_{k-1},-1,1)$ notice that $ g(A)$ decrease in one unit from the previous one. $ 2)$ If $ g(A)=0$ then we are done. $ 3)$ Otherwise let $ a_j=$ the first element from the right of $ A$ equal to $ 2$ then from $ 2$ $ 3^i=3^{i+1}-3^{i}$ redefine $ A=(a_0,a_1,\cdots,a_{j-1},-1,a_{j+1}=a_{j+1}+1,a_{j+2},\cdots,a_k)$ notice that the new $ a_{j+1} \in \{0,1,2\}$ thus $ g(A)$ is nonincreasing Repeating the steps $ 2$ or $ 3$ and because the array $ A$ is finite, $ g(A)$ for same step reachs the rightmost element of $ A$ and then decrease by one. At the end we get to $ g(A)=0$ and the result follows.
25.10.2007 00:19
25.10.2007 00:29
In fact, that algorithm works for any base $ n$ and numbers $ a_1, a_2, ..., a_n$ that cover all residues $ \mod n$. It just may happen that you get an infinite representation (we get $ n$-adic numbers, thus for example $ 1+n+n^2+n^3+... =1-n$).
25.10.2007 00:40
Another way is that for a given positive integer $ n$, the decompositions with the form $ a_0 + \cdots a_n3^n$, where $ a_i \in \{-1,0,1\}$ are pairwise distincts. Moreover any number with that form belongs to $ E_n = \{ -\frac {3^{n+1}-1}{2}, \cdots ,\frac {3^{n+1}-1}{2}\}$ and this set contains exactly $ 3^{n+1}$ integers. In another hand, there are exactly $ 3^{n+1}$ decompositions (three choices for each $ a_i$), thus each integer in $ E_n$ can be written as desired. Since, this is true for any $ n$ we get the desired conclusion. Pierre.