What's $-\frac{1}{27}$ in the p-adic ring $\Bbb Z_2$?

You are not correct to assume that $x+512x=-1$. You have a couple zero bits in the actual sum:

$x+512x=513x=...1111111111111\color{blue}{0}11\color{blue}{0}1$

and this is $-19$ in $2$-adics. Thereby $x=-19/513$ and when you reduce this to lowest terms you end with ... $-1/27$.


This probably doesn’t help a bit, but:

The period of $2$ in $\Bbb Z/(3)^\times$ is two. And $-\frac13$ has $2$-adic period two.
The period of $2$ in $\Bbb Z/(9)^\times$ is six. And $-\frac19$ has $2$-adic period six.
In general, the period of $2$ in $\Bbb Z/(3^n)^\times$ is $2\cdot3^{n-1}$. And we expect that the $2$-adic expansion of $-3^n$ should be purely periodic, period $2\cdot3^{n-1}$.

Indeed, since $3^n|(2^{2\cdot3^{n-1}}-1)$, say with quotient $q_n$, we get the results \begin{align} q_n &= \frac{2^{2\cdot3^{n-1}}-1}{3^n}\\ -\frac1{3^n}&=\frac{q_n}{1-2^{2\cdot3^{n-1}}}\,, \end{align} in which the second line says that the number of binary digits in the repeating block of the $2$-adic expansion of $3^{-n}$ is $2\cdot3^{n-1}$, and what’s in the block is the number $q_n$.

In the case of $n=3$, we get $-\frac1{27}=9709+9709\cdot2^{18}+9709\cdot2^{36}+\cdots$, and surenough, the binary expansion of $9709$ is $\quad000\>010\>010\quad111\>101\>101$. I can’t imagine how one would prove your claim.


EDIT: Addition

I think I have it. But you must check this over carefully, because to me it’s looking like magic, or at least like very devious sleight-of-hand.

To avoid multiple braces in my typing, I”m going to renumber, calling $N=n-1$, so that in my favorite example of the expansion of $-1/27$, we’ll have $N=2$.And I’ll call $$ Q_N=\frac{2^{2\cdot3^N}-1}{3^{N+1}}\,, $$ pretty much as I did above before the renumbering.

Now, what we know is that $2^{2\cdot3^N}-1\equiv0\pmod{3^{N+1}}$, so we can factor $$ \left(2^{3^N}-1\right)\left(2^{3^N}+1\right)\equiv0\pmod{3^{N+1}}\,, $$ but please note that since $3^{N+1}$ is odd, we see that the left-hand factor above is $\equiv1\pmod3$, in particular relatively prime to $3$, and thus to $3^{N+1}$ as well. Thus $3^{N+1}$ divides the right-hand factor, i.e. $3^{N+1}\mid(2^{3^N}+1)$, and once again to make typing easier for myself, I’ll call the quotient $\Omega$. Thus we have: \begin{align} \Omega&=\frac{2^{3^N}+1}{3^{N+1}}\\ 0&<\Omega<2^{3^N}\\ Q_N&=\Omega\left(2^{3^N}-1\right)\\ &=2^{3^N}(\Omega-1)+\left(2^{3^N}-\Omega\right)\\ \text{where we note }0&<2^{3^N}-\Omega<2^{3^N}\,. \end{align}

And that gives us our expression for $Q_N=2^{3^N}a+b$ with both $a$ and $b$ in the interval $\langle0,2^{3^N}\rangle$, namely $a=\Omega-1$ and $b=2^{3^N}-\Omega$. And surenough, $a+b=2^{3^N}-1$, as we desired.


I am not sure what the actual question is. What should be clear is that $$ -\frac1{27}=\frac1{1-28}=\sum_{k=0}^\infty28^k=\sum_{k=0}^\infty2^{2k}(1+2+2^2)^k. $$ It is not obvious (to me, at least) what would be the last expression in the form $\sum\epsilon_k2^k$ with $\epsilon_k\in\{0,1\}$.


Note: Suppose that the sequence is definitely periodic, i.e. suppose that there exists $r\geq0$ and $\ell\geq1$ such that $$ z=\sum_{k=0}^\infty\epsilon_k2^k=\underbrace{(\epsilon_0+\cdots\epsilon_{r-1}2^{r-1})}_{:=M}+2^{r}\sum_{j=0}^\infty2^{j\ell}\underbrace{(\epsilon_r+\cdots+\epsilon_{r+\ell-1}2^{\ell-1})}_{:=N}. $$ Then $$ z=M+2^r\frac{N}{1-2^{\ell}}. $$ Thus the only rational numbers that have a definitely periodic expansion are those of the above form with $M$ and $N\in\Bbb{Z}^{>0}$.