In number theory, given a prime number p, the p-adic numbers form an extension of the rational numbers which is distinct from the real numbers, though with some similar properties; p-adic numbers can be written in a form similar to (possibly infinite) decimals, but with digits based on a prime number p rather than ten, and extending to the left rather than to the right.
For example, comparing the expansion of the rational number 1 5 {\displaystyle {\tfrac {1}{5}}} in base 3 vs. the 3-adic expansion,
Formally, given a prime number p, a p-adic number can be defined as a series
where k is an integer (possibly negative), and each a i {\displaystyle a_{i}} is an integer such that 0 ≤ a i < p . {\displaystyle 0\leq a_{i}<p.} A p-adic integer is a p-adic number such that k ≥ 0. {\displaystyle k\geq 0.}
In general the series that represents a p-adic number is not convergent in the usual sense, but it is convergent for the p-adic absolute value | s | p = p − k , {\displaystyle |s|_{p}=p^{-k},} where k is the least integer i such that a i ≠ 0 {\displaystyle a_{i}\neq 0} (if all a i {\displaystyle a_{i}} are zero, one has the zero p-adic number, which has 0 as its p-adic absolute value).
Every rational number can be uniquely expressed as the sum of a series as above, with respect to the p-adic absolute value. This allows considering rational numbers as special p-adic numbers, and alternatively defining the p-adic numbers as the completion of the rational numbers for the p-adic absolute value, exactly as the real numbers are the completion of the rational numbers for the usual absolute value.
p-adic numbers were first described by Kurt Hensel in 1897, though, with hindsight, some of Ernst Kummer's earlier work can be interpreted as implicitly using p-adic numbers.