In basic number theory, for a given prime number p, the p-adic order of a positive integer n is the highest exponent $\nu _{p}$ such that $p^{\nu _{p}}$ divides n. This function is easily extended to positive rational numbers r = a/b by

$r=p_{1}^{\nu _{p_{1}}}p_{2}^{\nu _{p_{2}}}\cdots p_{k}^{\nu _{p_{k}}}=\prod _{i=1}^{k}p_{i}^{\nu _{p_{i}}},$ where $p_{1} are primes and the $\nu _{p_{i}}$ are (unique) integers (considered to be 0 for all primes not occurring in r so that $\nu _{p_{i}}(r)=\nu _{p_{i}}(a)-\nu _{p_{i}}(b)$ ).

This p-adic order constitutes an (additively written) valuation, the so-called p-adic valuation, which when written multiplicatively is an analogue to the well-known usual absolute value. Both types of valuations can be used for completing the field of rational numbers, where the completion with a p-adic valuation results in a field of p-adic numbers p (relative to a chosen prime number p), whereas the completion with the usual absolute value results in the field of real numbers . Distribution of natural numbers by their 2-adic order, labeled with corresponding powers of two in decimal. Zero always has an infinite order.

## Definition and properties

Let p be a prime number.

### Integers

$\nu _{p}:\mathbb {Z} \to \mathbb {N}$ defined by

$\nu _{p}(n)={\begin{cases}\mathrm {max} \{k\in \mathbb {N} :p^{k}\mid n\}&{\text{if }}n\neq 0\\\infty &{\text{if }}n=0,\end{cases}}$ where $\mathbb {N}$ denotes the natural numbers.

For example, $\nu _{3}(-45)=2$ and $\nu _{5}(-45)=1$ since $|{-45}|=45=3^{2}\cdot 5^{1}$ .

The notation $p^{k}\parallel n$ is sometimes used to mean $k=\nu _{p}(n)$ .

### Rational numbers

The p-adic order can be extended into the rational numbers as the function

$\nu _{p}:\mathbb {Q} \to \mathbb {Z}$ defined by

$\nu _{p}\left({\frac {a}{b}}\right)=\nu _{p}(a)-\nu _{p}(b).$ For example, $\nu _{2}{\bigl (}{\tfrac {9}{8}}{\bigr )}=-3$ and $\nu _{3}{\bigl (}{\tfrac {9}{8}}{\bigr )}=2$ since ${\tfrac {9}{8}}={\tfrac {3^{2}}{2^{3}}}$ .

Some properties are:

{\begin{aligned}\nu _{p}(m\cdot n)&=\nu _{p}(m)+\nu _{p}(n)\\[5px]\nu _{p}(m+n)&\geq \min {\bigl \{}\nu _{p}(m),\nu _{p}(n){\bigr \}}.\end{aligned}} Moreover, if $\nu _{p}(m)\neq \nu _{p}(n)$ , then

$\nu _{p}(m+n)=\min {\bigl \{}\nu _{p}(m),\nu _{p}(n){\bigr \}}$ where min is the minimum (i.e. the smaller of the two).

The p-adic absolute value on is the function

$|\cdot |_{p}\colon \mathbb {Q} \to \mathbb {R} _{\geq 0}$ defined by

$|r|_{p}=p^{-\nu _{p}(r)}.$ For example, $|{-45}|_{3}={\tfrac {1}{9}}$ and ${\bigl |}{\tfrac {9}{8}}{\bigr |}_{2}=8.$ The p-adic absolute value satisfies the following properties.

 Non-negativity $|a|_{p}\geq 0$ Positive-definiteness $|a|_{p}=0\iff a=0$ Multiplicativity $|ab|_{p}=|a|_{p}|b|_{p}$ Non-Archimedean $|a+b|_{p}\leq \max \left(|a|_{p},|b|_{p}\right)$ The symmetry $|{-a}|_{p}=|a|_{p}$ follows from multiplicativity $|ab|_{p}=|a|_{p}|b|_{p}$ and the subadditivity $|a+b|_{p}\leq |a|_{p}+|b|_{p}$ from the non-Archimedean triangle inequality $|a+b|_{p}\leq \max \left(|a|_{p},|b|_{p}\right)$ .

The choice of base p in the exponentiation $p^{-\nu _{p}(r)}$ makes no difference for most of the properties, but supports the product formula:

$\prod _{0,p}|x|_{p}=1$ where the product is taken over all primes p and the usual absolute value, denoted $|x|_{0}$ . This follows from simply taking the prime factorization: each prime power factor $p^{k}$ contributes its reciprocal to its p-adic absolute value, and then the usual Archimedean absolute value cancels all of them.

The p-adic absolute value is sometimes referred to as the "p-adic norm",[citation needed] although it is not actually a norm because it does not satisfy the requirement of homogeneity.

A metric space can be formed on the set with a (non-Archimedean, translation-invariant) metric

$d\colon \mathbb {Q} \times \mathbb {Q} \to \mathbb {R} _{\geq 0}$ defined by

$d(x,y)=|x-y|_{p}.$ The completion of with respect to this metric leads to the field p of p-adic numbers.