P-adic numbers
P-adic numbers are a "completion" of the rationals with a different magnitude function for each prime, p.The magnitude function is \( |x|_p = \frac{1}{p^{v_p(x)}} \) where \(v_p(x)\) counts the number of factors of p in x.
A p-adic number with an infinite leading zeros, is isomorphic to a natural number e.g. \([...0,0,1,3,2]_5 = 2 + 3\times 5 + 1\times 5^2 \)
Here we create the 3-adic number \([...,2,2,2]_3 = -1\)
There's no simple way to convert a p-adic to a Real number. (Not all real numbers can be represented by p-adics and vice-versa). When it has an infinite leading repeated sequence of digits then it is equivalent to a rational number.