Suppose I have a rational number expressed in p-adic form, but truncated at some digit. E.g., $...111000111001_2$ truncated to $111000111001_2$ (which I understand are equivalent to ${\frac{1}{9}_{10}}$ and $3641_{10}$ respectively).
Obviously a truncated number can be extended in an infinite number of ways, but is there a formula that will produce the "simplest" or perhaps all rational number(s) that might have been responsible for the truncated form?
Given the rational number $\,u/v,\,$ express it as a finite precision $p$-adic number $\,u/v = t + O(p^n).\,$ This means that $\,u/v \equiv t \pmod{ p^n}\,$ and $\,u = v\,t + w\, p^n\,$ for some number $w$. There are several ways to find $\,t\,$ given $\,u,v\,$ and $\,p^n.\,$ One method is to use Euclid's algorithm to solve the equation $\,u = v\,t + w\, p^n\,$ for $\,t,w.\,$ For example, to express $\,5/129\,$ up to $2$-adic precision $\,O(2^{12}),\,$ we get $\,5 = 129 \cdot 3461 -109 \cdot 2^{12}.\,$ To reverse the process, assume that we have $\,u/v = 3461 + O(2^{12})\,$ and want to find $\,u,v.\,$ Assuming that $\,u=5,\,$ the algorithm gives $\,5 = 129 \cdot 3461 - 109 \cdot 2^{12}\,$ and we recover $\,v=129.\,$ Assuming that $\,u=6,\,$ the algorithm gives $\,6 = -3122 \cdot 3461 + 2638 \cdot 2^{12}\,$ and we find $\,6/(-3122) = 3461 + O(2^{12}).\,$ Note that this process requires us to choose the numerator first and then finds the denomiator. To use your chosen example, we want to find $\, u/v = 3641 + O(2^{12})\,$ and suppose $\,u=1.\,$ Now the algorithm gives us $\,1 = 9 \cdot 3641 - 8 \cdot 2^{12}\,$ and $\,1/9 = 3641 + O(2^{12})\,$ is our approximation. Note that in this particular case, we can't do much better with a bigger numerator.
A similar method is used to find a rational number given a decimal approximation of a number $\,x.\,$ This big difference is that the algorithm gives rational upper and lower bounds at each step that get closer together at each step and the mediant of the bounds gets closer and closer to $\,x\,$at each step.