Solution (source code)

= Solution

The expansion is
$$
\boxed{-\frac{13}8=1+3+2\cdot3^2+3^3+2\cdot3^4+3^5+2\cdot3^6+\cdots=1,\overline{12}\quad\text{in base }3.}
$$
The notation has the units digit before the comma and successive positive powers afterwards, as defined in the source. To check it, the <geometric series> converges in the <p-adic absolute value>[3-adic norm] and its sum is $1+(3+2\cdot3^2)/(1-3^2)=1-21/8=-13/8$.

For the general repeating block, $|p^2|_p<1$ gives
$$
\boxed{a_0,\overline{a_1a_2}=a_0+\frac{a_1p+a_2p^2}{1-p^2}=\frac{a_0(1-p^2)+a_1p+a_2p^2}{1-p^2}.}
$$
Both numerator and denominator are <integers>, and the denominator is a $p$-adic <unit in a ring>[unit].