A p adic number is a way to extend the rational numbers that is distinct from the real numbers. They are written similar to bases, except that they extend to the left instead of the right like traditional numbers, where the bigger digits are considered 'smaller' than the smaller digits. The numbers can be written as an expanion. For integers, this is pretty straightforward and similar to base version. However, for negative and fractional numbers which are not made of powers of the base (this converter can only do negaative or positive integer values, fractions are a little difficult) the expansion is infinite. This is because the p adic numbers cannot have negative digits and only expand to the left, so decimals cannot be used. This leads to an infinite expansion, where the negative number is constantly carried over. Somewhere, infinitely far across the expansion there exists a power of the base which is multiplied by the negative number (kinda like 1111 (in 2s complement)) which cancels out the ever diverging numbers and causes it to converge.
To demonstrate this better, lets try to expand -4 in 5-adics. Firstly, find:
x = -4 mod 5
x = -4
Here, we run into our first problem, digits in p adics cannot be negative! Therefore, we need to 'carry' a five from the next digit and add five. So, the first digit must be 1. This can be written as:
-4 = 1 + 5(-1)
So, we have found the first digit of the expansion, so we move onto trying to expand -1, the second term in the expansion. Which means:
x = -1 mod 5
Once again, the remainder would be -1, so we need to 'carry' again to get 4, which can be written as:
-1 = 4 + 5(-1)
This process repeats infinitely, so we can write that expansion as: "...4441"