Can any integer be expressed as sums of powers of three?

1k Views Asked by At

I heard a long time ago that any integer can be expressed as sums (or differences) of powers of three, using each power only once. Examples:

$5=9-3-1$

$6=9-3$

$22=27-9+3+1$

etc.

To my surprise, I couldn't find anything about this on the Internet. So..

  1. Is this true? (So far I couldn't find any integer I can't express like this)
  2. Is there a proof to it?
  3. (Kind of a side question, assuming this is true): Is there a formula that gives the coefficients (-1, 0 or 1) for each power for a given integer?

Thanks

1

There are 1 best solutions below

0
On BEST ANSWER

This system is well-known and is called balanced ternary. It generalizes to all odd bases, but instead of the digits $-1,0$, and $1$, for base $2n+1$ you have the digits $0,\pm 1,\ldots,\pm n$; you can read a bit more here (with further generalizations in the rest of that article) and in this question and answer.