I am trying to prove that every positive integer can be represented as the sum or difference of distinct individual powers of 3 (Ex. $673=3^6-3^4+3^3-3^1+3^0$), and I would like to see if my proof is correct and valid and if there is anything I can format better.
Proof: Let $n$ be a positive integer. It is known that all positive integers can be represented in base 3, so $n=a_k3^k+a_{k-1}3^{k-1}+\cdots+a_1\cdot3^1+a_0\cdot3^0$, where $a_k\in\{0, 1, 2\}$ and $k$ is a positive integer. The case is trivial when $a_k=0$ or $a_k=1$ because the term will be either left out of the expression or added on individually. If $a_k=2$, then the term $a_k3^k=3\cdot3^k-3^k=3^{k+1}-3^k$. The expression can then be reevaluated, and if $a_k=2$ for any $k$, that term can be rewritten as a difference. The final result will then be the sum or difference of individual powers of 3.